Package akka.http.javadsl.server
Class RejectionHandlerBuilder
java.lang.Object
akka.http.javadsl.server.RejectionHandlerBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
<T extends Rejection>
RejectionHandlerBuilderHandles a singleRejection
with the given function.<T extends Rejection>
RejectionHandlerBuilderHandles several Rejections of the same type at the same time.Convenience method for handling rejections created by created by the onCompleteWithBreaker directive.handleNotFound
(Route route) Handles the special "not found" case using the givenRoute
.
-
Constructor Details
-
RejectionHandlerBuilder
-
-
Method Details
-
build
-
handle
Handles a singleRejection
with the given function.- Parameters:
t
- (undocumented)handler
- (undocumented)- Returns:
- (undocumented)
-
handleAll
public <T extends Rejection> RejectionHandlerBuilder handleAll(Class<T> t, Function<List<T>, Route> handler) Handles several Rejections of the same type at the same time. The list passed to the given function is guaranteed to be non-empty.- Parameters:
t
- (undocumented)handler
- (undocumented)- Returns:
- (undocumented)
-
handleCircuitBreakerOpenRejection
public RejectionHandlerBuilder handleCircuitBreakerOpenRejection(Function<CircuitBreakerOpenRejection, Route> handler) Convenience method for handling rejections created by created by the onCompleteWithBreaker directive. Signals that the request was rejected because the supplied circuit breaker is open and requests are failing fast.Use to customise the error response being written instead of the default
akka.http.javadsl.model.StatusCodes.SERVICE_UNAVAILABLE
response.- Parameters:
handler
- (undocumented)- Returns:
- (undocumented)
-
handleNotFound
Handles the special "not found" case using the givenRoute
.- Parameters:
route
- (undocumented)- Returns:
- (undocumented)
-