public static final class RejectionHandler.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder(boolean isDefault) |
Modifier and Type | Method and Description |
---|---|
RejectionHandler.Builder |
handle(scala.PartialFunction<Rejection,scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>> pf)
Handles a single
Rejection with the given partial function. |
<T extends Rejection> |
handleAll(scala.Function1<scala.collection.immutable.Seq<T>,scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>> f,
scala.reflect.ClassTag<T> evidence$1)
Handles several Rejections of the same type at the same time.
|
RejectionHandler.Builder |
handleCircuitBreakerOpenRejection(scala.Function1<CircuitBreakerOpenRejection,scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>> handler)
Convenience method for handling rejections created by the onCompleteWithBreaker directive.
|
RejectionHandler.Builder |
handleNotFound(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> route)
Handles the special "not found" case using the given
Route . |
RejectionHandler |
result() |
public RejectionHandler.Builder handle(scala.PartialFunction<Rejection,scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>> pf)
Rejection
with the given partial function.pf
- (undocumented)public <T extends Rejection> RejectionHandler.Builder handleAll(scala.Function1<scala.collection.immutable.Seq<T>,scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>> f, scala.reflect.ClassTag<T> evidence$1)
f
- (undocumented)evidence$1
- (undocumented)public RejectionHandler.Builder handleCircuitBreakerOpenRejection(scala.Function1<CircuitBreakerOpenRejection,scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>> handler)
Use to customise the error response being written instead of the default ServiceUnavailable
response.
handler
- (undocumented)public RejectionHandler.Builder handleNotFound(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> route)
Route
.route
- (undocumented)public RejectionHandler result()