Interface ErrorHandler<T extends Throwable>
- Type Parameters:
T- type of throwable handled by this handler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
The routing error handler.
Can be mapped to the error cause in
HttpRouting.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(ServerRequest req, ServerResponse res, T throwable) Error handling consumer.
-
Method Details
-
handle
Error handling consumer. Do not throw an exception from an error handler, it would make this error handler invalid and the exception would be ignored.The response retains the status configured before the failure. The error handler is responsible for configuring or deliberately retaining an appropriate status before sending a replacement response.
- Parameters:
req- the server requestres- the server responsethrowable- the cause of the error
-