Class ExceptionHandler

java.lang.Object
akka.http.javadsl.server.ExceptionHandler

public final class ExceptionHandler extends Object
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 Details

    • ExceptionHandler

      public ExceptionHandler()
  • Method Details