Class JaxRsExceptionInterceptor
java.lang.Object
ca.uhn.fhir.jaxrs.server.interceptor.JaxRsExceptionInterceptor
An interceptor that catches the jax-rs exceptions
- Author:
- Peter Van Houte | peter.vanhoute@agfa.com | Agfa Healthcare
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconvertException
(AbstractJaxRsProvider theServer, Throwable theException) This method convert an exception to a JaxRsResponseExceptionjakarta.ws.rs.core.Response
convertExceptionIntoResponse
(JaxRsRequest theRequest, JaxRsResponseException theException) This method converts an exception into a responseintercept
(jakarta.interceptor.InvocationContext ctx) This interceptor will catch all exception and convert them using the exceptionhandler
-
Constructor Details
-
JaxRsExceptionInterceptor
public JaxRsExceptionInterceptor()The default constructor
-
-
Method Details
-
intercept
This interceptor will catch all exception and convert them using the exceptionhandler- Parameters:
ctx
- the invocation context- Returns:
- the result
- Throws:
JaxRsResponseException
- an exception that can be handled by a jee container
-
convertException
public JaxRsResponseException convertException(AbstractJaxRsProvider theServer, Throwable theException) This method convert an exception to a JaxRsResponseException- Parameters:
theServer
- the providertheException
- the exception to convert- Returns:
- JaxRsResponseException
-
convertExceptionIntoResponse
public jakarta.ws.rs.core.Response convertExceptionIntoResponse(JaxRsRequest theRequest, JaxRsResponseException theException) throws IOException This method converts an exception into a response- Parameters:
theRequest
- the requesttheException
- the thrown exception- Returns:
- the response describing the error
- Throws:
IOException
-