Packages

final class ExceptionHandler extends AnyRef

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()
    ));

Source
ExceptionHandler.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ExceptionHandler
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. val asScala: scaladsl.server.ExceptionHandler
  2. def seal(settings: RoutingSettings): ExceptionHandler

    "Seals" this handler by attaching a default handler as fallback if necessary.

  3. def withFallback(that: ExceptionHandler): ExceptionHandler

    Creates a new ExceptionHandler which uses the given one as fallback for this one.