Class UniversalExceptionMapper

  • public class UniversalExceptionMapper
    extends Object
    Maps exceptions to suitable HTTP responses.

    Supports both, JAX-RS responses and Servlet API responses.

    2 additional aspects are handled: - Logging the exception. - Enriching the response with an error entity.

    • Constructor Detail

      • UniversalExceptionMapper

        public UniversalExceptionMapper​(Throwable e,
                                        javax.servlet.http.HttpServletRequest request)
    • Method Detail

      • toResponse

        public toResponse()
      • initResponse

        public void initResponse​(javax.servlet.http.HttpServletResponse response)
                          throws IOException