Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No such table #33

Closed
waghanza opened this issue Mar 8, 2016 · 2 comments
Closed

No such table #33

waghanza opened this issue Mar 8, 2016 · 2 comments

Comments

@waghanza
Copy link
Contributor

waghanza commented Mar 8, 2016

Hi,

When I try to execute an sql query on the wrong table, I have a raw error from PQ driver, but no

error.status

Is it a wanted behavior ?

Regards,

PS : Rather ask before PR

@will
Copy link
Owner

will commented Mar 9, 2016

Thanks for checking out this project and for the issue.

It looks like it is setting the status, but there isn't any way to access it. If you reopen the error class and add a getter it works. Is that what you were talking about?

require "pg"

class PG::ResultError
  getter status
end

DB = PG.connect("postgres:///")
begin
  DB.exec("select * from whatever")
rescue e : PG::ResultError
  p e.status # => PGRES_FATAL_ERROR
end

@will
Copy link
Owner

will commented Apr 17, 2016

Please feel free to reopen this if you're still having problems

@will will closed this as completed Apr 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants