Package javax.ws.rs.ext
Interface ExceptionMapper<E extends Throwable>
public interface ExceptionMapper<E extends Throwable>
Contract for a provider that maps Java exceptions to
Response
. An implementation of this interface must
be annotated with Provider
.- See Also:
-
Method Summary
-
Method Details
-
toResponse
Map an exception to aResponse
. Returningnull
results in aResponse.Status.NO_CONTENT
response. Throwing a runtime exception results in aResponse.Status.INTERNAL_SERVER_ERROR
response- Parameters:
exception
- the exception to map to a response- Returns:
- a response mapped from the supplied exception
-