-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add support for calling notify()
to report unhandled exceptions
#145
Comments
Thanks for getting in touch with a detailed report @stevenbenitez. We're aware that in certain scenarios it would be helpful to be able to toggle whether an error is handled/unhandled, and are deciding what the best approach would be for all the languages we support before we add this to our roadmap. Option 2 seems to be the most likely route we'll take, but we're still in the design phase and this is subject to change, so we wouldn't accept a PR at this stage. If you were comfortable with modifying a non-public API then I believe modifying |
Thanks for the response, @fractalwrench. I can appreciate wanting to design a consistent API for all of your languages/notifiers first. I'll pursue option 3 or your suggestion and then switch to the official solution when that is available. Thanks for building such a slick product! |
Is there any movement on this issue? Not being able to flag errors as 'unhandled' makes the stability score very difficult to use for java apps. |
Hi @sdufel, |
This is 2.5 years old. Is this being fixed? Is there any update? |
I just integrated Bugsnag into a Dropwizard application. In this application I have a mechanism in place to catch unhandled exceptions, log them, delegate to my own
ErrorReporter
interface, and then return an appropriate JSON response (e.g., 500 ISE).I integrated Bugsnag by creating a
BugsnagErrorReporter
and suppressing the automatic uncaught exception handler. This is working great, but as my implementation callsbugsnag.notify()
it reports all exceptions as handled. I would like to be able to report these as unhandled exceptions since they're being caught by a JAX-RSExceptionMapper
rather than in a catch block somewhere. There are other cases where I would want to report handled exceptions (i.e., places where I can gracefully recover but still want to know of a problem). This is similar in concept to how the Spring module is specifying aSeverityReasonType
ofREASON_UNHANDLED_EXCEPTION_MIDDLEWARE
in its various handlers.Looking at
Report
, thegetUnhandled()
method drives this setting in the JSON sent to Bugsnag and that method keys off of theHandledState
.Implementation Options:
Alter the
bugsnag.notify()
methods. There are a number of overloads and I am hesitant to disrupt this since it's the primary API a user would interact with.Alter the
Report
class to provide a way to flag the report as unhandled. e.g.,report.flagAsUnhandled()
,report.flagAsUnhandledFromMiddleware()
, or etc. This would change the underlyingHandledState
.Place my
BugsnagErrorReporter
in thecom.bugsnag
package in my own code so that I can access package-private functionality. This would solve my immediate problem but would require me to use a non-public API that could change later and doesn't help anyone else who may want to report unhandled exceptions themselves.I would be happy to create a PR that implements this, but I wanted to check with you first to see if this is something you agree with and/or if you have a preferred approach.
The text was updated successfully, but these errors were encountered: