Package pl.gsmservice.gateway.utils
Interface AsyncHook.AfterError
-
- All Known Implementing Classes:
AsyncHooks
- Enclosing class:
- AsyncHook
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface AsyncHook.AfterErrorSpecifies what happens if a request action throws an Exception.
-
-
Field Summary
Fields Modifier and Type Field Description static AsyncHook.AfterErrorDEFAULT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<Blob>>afterError(Hook.AfterErrorContext context, java.net.http.HttpResponse<Blob> response, java.lang.Throwable error)Either returns an HttpResponse or throws an Exception.
-
-
-
Field Detail
-
DEFAULT
static final AsyncHook.AfterError DEFAULT
-
-
Method Detail
-
afterError
java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<Blob>> afterError(Hook.AfterErrorContext context, java.net.http.HttpResponse<Blob> response, java.lang.Throwable error)
Either returns an HttpResponse or throws an Exception. Must be passed either a response or an error (both can't be absent).- Parameters:
context- context for the errorresponse- response information if available.error- the optional exception. If response present then the error is for-info only, it was the last error in the chain of AfterError hook calls leading to this one- Returns:
- HTTP response if method decides that an exception is not to be thrown
-
-