Class ExceptionHandler
java.lang.Object
org.apache.pekko.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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionasScala()static ExceptionHandlerBuilderCreates a new builder DSL for creating an ExceptionHandlerstatic ExceptionHandlerINTERNAL APIseal(RoutingSettings settings) "Seals" this handler by attaching a default handler as fallback if necessary.withFallback(ExceptionHandler that) Creates a newExceptionHandlerwhich uses the given one as fallback for this one.
- 
Constructor Details- 
ExceptionHandlerpublic ExceptionHandler()
 
- 
- 
Method Details- 
newBuilderCreates a new builder DSL for creating an ExceptionHandler- Returns:
- (undocumented)
 
- 
ofINTERNAL API
- 
asScala
- 
withFallbackCreates a newExceptionHandlerwhich 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)
 
 
-