Package akka.http.javadsl.server
Class ExceptionHandler
java.lang.Object
akka.http.javadsl.server.ExceptionHandler
Handles exceptions by turning them into routes. You can create an exception handler in Java code like the following example:
ExceptionHandler myHandler = ExceptionHandler.of (ExceptionHandler.newPFBuilder() .match(IllegalArgumentException.class, x -> Directives.complete(StatusCodes.BAD_REQUEST)) .build() ));
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasScala()
static ExceptionHandlerBuilder
Creates a new builder DSL for creating an ExceptionHandlerstatic ExceptionHandler
INTERNAL APIseal
(RoutingSettings settings) "Seals" this handler by attaching a default handler as fallback if necessary.withFallback
(ExceptionHandler that) Creates a newExceptionHandler
which uses the given one as fallback for this one.
-
Constructor Details
-
ExceptionHandler
public ExceptionHandler()
-
-
Method Details
-
newBuilder
Creates a new builder DSL for creating an ExceptionHandler- Returns:
- (undocumented)
-
of
INTERNAL API -
asScala
-
withFallback
Creates a newExceptionHandler
which uses the given one as fallback for this one.- Parameters:
that
- (undocumented)- Returns:
- (undocumented)
-
seal
"Seals" this handler by attaching a default handler as fallback if necessary.- Parameters:
settings
- (undocumented)- Returns:
- (undocumented)
-