public final class ExceptionHandler
extends java.lang.Object
ExceptionHandler myHandler = ExceptionHandler.of (ExceptionHandler.newPFBuilder() .match(IllegalArgumentException.class, x -> Directives.complete(StatusCodes.BAD_REQUEST)) .build() ));
Constructor and Description |
---|
ExceptionHandler() |
Modifier and Type | Method and Description |
---|---|
ExceptionHandler |
asScala() |
static ExceptionHandlerBuilder |
newBuilder()
Creates a new builder DSL for creating an ExceptionHandler
|
static ExceptionHandler |
of(scala.PartialFunction<java.lang.Throwable,Route> pf)
INTERNAL API
|
ExceptionHandler |
seal(RoutingSettings settings)
"Seals" this handler by attaching a default handler as fallback if necessary.
|
ExceptionHandler |
withFallback(ExceptionHandler that)
Creates a new
ExceptionHandler which uses the given one as fallback for this one. |
public static ExceptionHandlerBuilder newBuilder()
public static ExceptionHandler of(scala.PartialFunction<java.lang.Throwable,Route> pf)
public ExceptionHandler asScala()
public ExceptionHandler withFallback(ExceptionHandler that)
ExceptionHandler
which uses the given one as fallback for this one.that
- (undocumented)public ExceptionHandler seal(RoutingSettings settings)
settings
- (undocumented)