Package systems.dmx.core.util
Class UniversalExceptionMapper
- java.lang.Object
-
- systems.dmx.core.util.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 Summary
Constructors Constructor Description UniversalExceptionMapper(Throwable e, javax.servlet.http.HttpServletRequest request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
initResponse(javax.servlet.http.HttpServletResponse response)
javax.ws.rs.core.Response
toResponse()
-
-
-
Constructor Detail
-
UniversalExceptionMapper
public UniversalExceptionMapper(Throwable e, javax.servlet.http.HttpServletRequest request)
-
-
Method Detail
-
toResponse
public javax.ws.rs.core.Response toResponse()
-
initResponse
public void initResponse(javax.servlet.http.HttpServletResponse response) throws IOException
- Throws:
IOException
-
-