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

Don't crash when original_exception is nil #212

Merged

Conversation

christophermanning
Copy link
Contributor

Check that exception.orignal_exception is an exception if the exception respond_to? :orignal_exception

Certain exception types respond_to? original_exception, but the value may not be set
and it would cause an undefined method message for nil class exception in better_errors.

Check that exception.orignal_exception is an exception if the exception respond_to? :orignal_exception

[Certain exception types](http://api.rubyonrails.org/classes/ActiveRecord/StatementInvalid.html) respond_to? original_exception, but [the value may not be set](
https://github.com/rails/rails/blob/df2226ea16922fd4e2ea72b8ee372a4cb5621114/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L499)
and it would cause an [undefined method message for nil class exception in better_errors](https://github.com/charliesome/better_errors/blob/3be2c834e8a644cfd5436f0b107c70d713f46de6/lib/better_errors/middleware.rb#L118).
@haileys
Copy link
Collaborator

haileys commented Nov 30, 2013

Thanks!

haileys pushed a commit that referenced this pull request Nov 30, 2013
Don't crash when original_exception is nil
@haileys haileys merged commit 816f127 into BetterErrors:master Nov 30, 2013
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