-
Notifications
You must be signed in to change notification settings - Fork 174
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
Handle 'nil' being notified #439
Conversation
Cawllec
commented
Mar 19, 2018
- Changes 'nil' to a string: "'nil' was notified as an exception"
- Fixes Bugsnag throwing exception during notification process
- Changes 'nil' to a string: "'nil' was notified as an exception" - Fixes Bugsnag throwing exception during notification process
spec/report_spec.rb
Outdated
event = payload["events"][0] | ||
exception = event["exceptions"][0] | ||
expect(exception["errorClass"]).to eq("RuntimeError") | ||
expect(exception["message"]).to eq(Bugsnag::Report::NIL_EXCEPTION_DESCRIPTION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the stacktrace look like in this case? It would be good to verify that it is also sensible in a test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the test to look at the stacktrace as well now.
This is waiting for the refactoring change to be merged first #440 |
Why does this depend on the refactoring? Why was this not done in the Bugsnag Client? We already have a bunch of validation of input in there. |
To avoid continually adding exceptions to rubocop I thought small refactoring tasks (such as breaking |
I still have a question about this being done in report rather than in the client. |
It makes sense to me that the |
The notify method is the public interface, and so it validates user input - it should be there. |
- Moved nil handling logic from Report to Client
- Refactor of delivery flags into separate 'deliver_notification?' private method
I've moved the nil exception changes into the Client, and refactored the configuration checks into a private |
- Refactor of deliver_notification? to make it less complex