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

Support Ruby's standard behavior on custom exceptions #187

Merged
merged 1 commit into from
Feb 6, 2012
Merged

Support Ruby's standard behavior on custom exceptions #187

merged 1 commit into from
Feb 6, 2012

Conversation

clemens
Copy link
Contributor

@clemens clemens commented Feb 6, 2012

Ruby's standard behavior for Exception#inspect is to show <ExceptionClass: ExceptionClass>
when no message is given and <ExceptionClass: message> if a message is given. Custom exceptions
should reflect this behavior.

The problem is fairly obvious when, for instance, using Resque: Instead of displaying the (helpful) Facebook error message, one merely gets "FbGraph::InvalidRequest" which is not helpful for debugging/bugfixing at all. The pull request fixes this issue by calling super at the end.

Ruby's standard behavior for Exception#inspect is to show <ExceptionClass: ExceptionClass>
when no message is given and <ExceptionClass: message> if a message is given. Custom exceptions
should reflect this behavior.
nov added a commit that referenced this pull request Feb 6, 2012
Support Ruby's standard behavior on custom exceptions
@nov nov merged commit 713745c into nov:master Feb 6, 2012
nov added a commit that referenced this pull request Feb 6, 2012
@nov
Copy link
Owner

nov commented Feb 6, 2012

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants