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

improve exception naming #260

Closed
abacha opened this issue Apr 24, 2012 · 4 comments
Closed

improve exception naming #260

abacha opened this issue Apr 24, 2012 · 4 comments
Milestone

Comments

@abacha
Copy link

abacha commented Apr 24, 2012

All the errors raise the same exception "Mysql2::Error", it would be nice if we have specific exceptions for each error like: "invalid query", "connection closed" etc
so it could be handled on the code

@brianmario
Copy link
Owner

I definitely plan on adding specific exceptions for all of the different error types MySQL can return. Just need to find the time to do it (out of town currently). I was planning on going through the list of error codes we can get back from MySQL (via http://dev.mysql.com/doc/refman/5.5/en/error-messages-server.html ?) and create exception classes which extend from Mysql2::Error for all of them or at least the ones that make sense.

Then I can centralize the error handling in Mysql2 itself so that these new exception classes would be raised for those specific error codes. It shouldn't break anyone currently rescuing from Mysql2::Error since these new classes would extend from it.

@brianmario
Copy link
Owner

Just FYI - I'm still planning on doing this but it won't be in 0.3.12 which I'm hoping to release within a couple of days.

@simi
Copy link
Contributor

simi commented Jul 25, 2013

duplicate of #404

@sodabrew sodabrew added this to the 0.4.0 milestone Jul 29, 2014
@sodabrew sodabrew modified the milestones: 0.4.0, 0.5.0 Aug 5, 2015
@sodabrew
Copy link
Collaborator

I think #911 makes good progress. Closing as done!

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

4 participants