bugsnag-java icon indicating copy to clipboard operation
bugsnag-java copied to clipboard

Support for @ResponseStatus on custom exceptions

Open peterkarrer opened this issue 5 years ago • 0 comments

Expected behavior

When throwing an exception from a Controller/RestController that is annotated with @ResponseStatus with an HTTP status code in the 4xx range, the exception should be reported to Bugsnag with severity INFO.

Observed behavior

Custom exceptions annotated with @ResponseStatus are always reported with severity ERROR independent from the HTTP status that is set. At the moment there is no code in ExceptionClassCallback that would handle such exceptions.

Steps to reproduce

  • Create a custom exception class with @ResponseStatus and an HTTP status in the 4xx range
  • Throw this exception from a Controller/RestController
  • The exception is shown with severity ERROR in Bugsnag

Version

bugsnag-spring 3.4.4

Additional information

Since we typically use custom exceptions for client errors, a fix to this problem would greatly improve our user experience with Bugsnag. Thanks for looking into this!

peterkarrer avatar Feb 28 '19 10:02 peterkarrer