Skip to content

Provide exception that is automatically converted into standard ErrorMessage response with custom, application-specific error code #3

@ewencp

Description

We already setup WebApplicationExceptionMapper to convert WebApplicationExceptions to ErrorMessages and set the correct response code. However, the error code reported in the JSON response is just the HTTP status code. It should be easy to customize the error code to provide more machine readable information (to complement the human readable error message) while maintaining the HTTP status code.

This could either work with the existing exception mapper (i.e. subclass WebApplicationException and detect the subtype when converting to ErrorMessage) or use it's own independent type. Either way, it would also be helpful to provide all the convenience subclasses like NotFoundException as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions