Interface WebApplicationExceptionWrapper<T extends javax.ws.rs.WebApplicationException>
-
- All Known Implementing Classes:
ResteasyBadRequestException
,ResteasyClientErrorException
,ResteasyForbiddenException
,ResteasyInternalServerErrorException
,ResteasyNotAcceptableException
,ResteasyNotAllowedException
,ResteasyNotAuthorizedException
,ResteasyNotFoundException
,ResteasyNotSupportedException
,ResteasyRedirectionException
,ResteasyServerErrorException
,ResteasyServiceUnavailableException
,ResteasyWebApplicationException
public interface WebApplicationExceptionWrapper<T extends javax.ws.rs.WebApplicationException>
An interface which allows aWebApplicationException
to be unwrapped.- Author:
- James R. Perkins
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static javax.ws.rs.core.Response
sanitize(javax.ws.rs.core.Response response)
Sanitizes the response by creating a new response with only the status code, allowed methods, entity and the media type.T
unwrap()
Returns the original, unwrapped, exception.static javax.ws.rs.WebApplicationException
unwrap(javax.ws.rs.WebApplicationException e)
Unwraps the exception if the passed in expression is aWebApplicationExceptionWrapper
.static javax.ws.rs.WebApplicationException
wrap(javax.ws.rs.WebApplicationException e)
If theresteasy.original.webapplicationexception.behavior
is set totrue
or the request is determined to not be a server side request, then theWebApplicationException
passed in will be returned.
-
-
-
Method Detail
-
wrap
static javax.ws.rs.WebApplicationException wrap(javax.ws.rs.WebApplicationException e)
If theresteasy.original.webapplicationexception.behavior
is set totrue
or the request is determined to not be a server side request, then theWebApplicationException
passed in will be returned. If the property is not set totrue
and this is a server side request then the exception is wrapped and the response is sanitized.- Parameters:
e
- the exception to possibly wrapped- Returns:
- the wrapped exception or the original exception if the exception has already been wrapped the the wrapping feature is turned off
-
unwrap
static javax.ws.rs.WebApplicationException unwrap(javax.ws.rs.WebApplicationException e)
Unwraps the exception if the passed in expression is aWebApplicationExceptionWrapper
. Otherwise the exception passed in is returned.- Parameters:
e
- the exception to unwrap- Returns:
- the unwrapped exception or the exception parameter itself if it was not a
WebApplicationExceptionWrapper
-
sanitize
static javax.ws.rs.core.Response sanitize(javax.ws.rs.core.Response response)
Sanitizes the response by creating a new response with only the status code, allowed methods, entity and the media type. All other information is removed.- Parameters:
response
- the response to sanitize.- Returns:
- the new response
-
unwrap
T unwrap()
Returns the original, unwrapped, exception.- Returns:
- the original exception
-
-