Class WebApplicationExceptionMapper

  • All Implemented Interfaces:
    javax.ws.rs.ext.ExceptionMapper<javax.ws.rs.WebApplicationException>

    @Provider
    public class WebApplicationExceptionMapper
    extends Object
    implements javax.ws.rs.ext.ExceptionMapper<javax.ws.rs.WebApplicationException>
    Map WebApplicationException to Response.

    The mapped response has status code 500 (Bad Request) and media type JSON.

    • Constructor Detail

      • WebApplicationExceptionMapper

        public WebApplicationExceptionMapper()
    • Method Detail

      • toResponse

        public javax.ws.rs.core.Response toResponse​(javax.ws.rs.WebApplicationException exception)
        Convert the given WebApplicationException to a response containing a JSON entity. The response status code matches the status of the Response referenced by the WebApplicationException.
        Specified by:
        toResponse in interface javax.ws.rs.ext.ExceptionMapper<javax.ws.rs.WebApplicationException>
        Parameters:
        exception - the exception to convert
        Returns:
        a response
        See Also:
        JaxrsExceptionMapper.buildResponse(JaxrsException)