-
public interface ErrorHandling
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceErrorHandling.ServiceAdds to the Routing.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ErrorHandlingerror(int statusCode, Handler handler)Adds an error mapper to the instance.ErrorHandlingerror(int statusCode, String contentType, Handler handler)Adds an error mapper for the specified content-type to the instance.<T extends Exception>
ErrorHandlingexception(Class<T> exceptionClass, ExceptionHandler<T> handler)Register an exception handler for the given exception type.<T extends Exception>
ExceptionHandler<Exception>find(Class<T> exceptionType)Return a registered exception handler given the exception type or null if one is not found.
-
-
-
Method Detail
-
exception
<T extends Exception> ErrorHandling exception(Class<T> exceptionClass, ExceptionHandler<T> handler)
Register an exception handler for the given exception type.
-
error
ErrorHandling error(int statusCode, Handler handler)
Adds an error mapper to the instance. Useful for turning error-codes (404, 500) into standardized messages/pages
-
error
ErrorHandling error(int statusCode, String contentType, Handler handler)
Adds an error mapper for the specified content-type to the instance. Useful for turning error-codes (404, 500) into standardized messages/pages
-
find
<T extends Exception> ExceptionHandler<Exception> find(Class<T> exceptionType)
Return a registered exception handler given the exception type or null if one is not found.This includes searching the super types of the exception.
-
-