Package io.undertow.server.handlers
Class ExceptionHandler
- java.lang.Object
-
- io.undertow.server.handlers.ExceptionHandler
-
- All Implemented Interfaces:
HttpHandler
public class ExceptionHandler extends java.lang.Object implements 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 Modifier and Type Field Description static AttachmentKey<java.lang.Throwable>
THROWABLE
-
Constructor Summary
Constructors Constructor Description ExceptionHandler(HttpHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends java.lang.Throwable>
ExceptionHandleraddExceptionHandler(java.lang.Class<T> clazz, HttpHandler handler)
void
handleRequest(HttpServerExchange exchange)
Handle the request.
-
-
-
Field Detail
-
THROWABLE
public static final AttachmentKey<java.lang.Throwable> THROWABLE
-
-
Constructor Detail
-
ExceptionHandler
public ExceptionHandler(HttpHandler handler)
-
-
Method Detail
-
handleRequest
public void handleRequest(HttpServerExchange exchange) throws java.lang.Exception
Description copied from interface:HttpHandler
Handle the request.- Specified by:
handleRequest
in interfaceHttpHandler
- Parameters:
exchange
- the HTTP request/response exchange- Throws:
java.lang.Exception
-
addExceptionHandler
public <T extends java.lang.Throwable> ExceptionHandler addExceptionHandler(java.lang.Class<T> clazz, HttpHandler handler)
-
-