Skip to content

ExceptionMapperBase.toResponse has no protection if toProblem() throws or returns null #670

Description

@phillip-kruger

If a subclass's toProblem() implementation throws an exception or returns null, ExceptionMapperBase.toResponse() crashes with an unhelpful error. The original mapped HttpProblem is lost and the user gets an uncontrolled error instead of a proper application/problem+json response.

The method should catch exceptions from toProblem() and handle null returns by falling back to a generic 500 problem response.

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