Package io.undertow.server.handlers
Class ExceptionHandler
java.lang.Object
io.undertow.server.handlers.ExceptionHandler
- All Implemented Interfaces:
HttpHandler
Handler that dispatches to a given handler and allows mapping exceptions
to be handled by additional handlers. The order the exception handlers are
added is important because of inheritance. Add all child classes before their
parents in order to use different handlers.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Throwable>
ExceptionHandleraddExceptionHandler
(Class<T> clazz, HttpHandler handler) void
handleRequest
(HttpServerExchange exchange) Handle the request.
-
Field Details
-
THROWABLE
-
-
Constructor Details
-
ExceptionHandler
-
-
Method Details
-
handleRequest
Description copied from interface:HttpHandler
Handle the request.- Specified by:
handleRequest
in interfaceHttpHandler
- Parameters:
exchange
- the HTTP request/response exchange- Throws:
Exception
-
addExceptionHandler
public <T extends Throwable> ExceptionHandler addExceptionHandler(Class<T> clazz, HttpHandler handler)
-