Class ErrorHandlers

java.lang.Object
io.helidon.webserver.http.ErrorHandlers

public final class ErrorHandlers extends Object
Http routing Error handlers.
  • Method Details

    • create

      public static ErrorHandlers create(Map<Class<? extends Throwable>,ErrorHandler<?>> errorHandlers)
      Create error handlers.
      Parameters:
      errorHandlers - map of type to error handler
      Returns:
      new error handlers
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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 context
      request - HTTP server request
      response - HTTP server response
      task - task to execute