-
Notifications
You must be signed in to change notification settings - Fork 144
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
Raising rescued exceptions in Development mode #72
Comments
Thanks for the suggestion! Unfortunately I see a few problems with this. Many people have logic in their code which comes after calling If you want to use this everywhere, I'd either override the def report_exception(ex)
if Rails.env.development?
raise ex # or logger.error(ex)
else
notify_honeybadger(ex)
end
end |
You are right that re-raising the exception might not be such a good idea since the code after that would not be executed in development. But then don't you think it would be at least a good idea to log the error in the console so we know something is happening? Or maybe have a global config to determine what should be the behaviour? Maybe a block of code like you have for the
I could also implement a |
Hey Pierre, sorry for not replying sooner! I get what you're saying, but I'm still not convinced this is something which belongs in the Honeybadger gem. Honeybadger is providing notification of errors, but it's still up to the user to handle the errors themselves. In your case I recommend creating your own error handling abstraction which will both notify Honeybadger in production and log in development (kind of like the |
When running in local, honeybadger will not send exceptions which is fine. But it will also swallow manually rescued exceptions without any notices like in the example mentioned here : http://docs.honeybadger.io/article/32-log-ruby-exceptions-already-rescued
Here is the behaviour I would like to see implemented directly in the
notify_honeybadger
method :I could of course do this all over my code but it would bloat it and I really think it would be helpful for most developers to see exceptions raised locally. What do you think ?
The text was updated successfully, but these errors were encountered: