java.lang.Object
io.helidon.webserver.http.ErrorHandlers
Http routing Error handlers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ErrorHandlers
create
(Map<Class<? extends Throwable>, ErrorHandler<?>> errorHandlers) Create error handlers.void
runWithErrorHandling
(ConnectionContext ctx, RoutingRequest request, RoutingResponse response, Callable<Void> task) Run a task and handle the errors, if any.toString()
-
Method Details
-
create
Create error handlers.- Parameters:
errorHandlers
- map of type to error handler- Returns:
- new error handlers
-
toString
-
runWithErrorHandling
public void runWithErrorHandling(ConnectionContext ctx, RoutingRequest request, RoutingResponse response, Callable<Void> task) Run a task and handle the errors, if any. Uses error handlers configured on routing. Correctly handles all expected (and unexpected) exceptions that can happen in filters and routes.- Parameters:
ctx
- connection contextrequest
- HTTP server requestresponse
- HTTP server responsetask
- task to execute
-