Skip to content

Support for @ResponseStatus on custom exceptions #134

Description

@peterkarrer

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions