Package org.signal.libsignal.net
Class RequestResultKt
-
- All Implemented Interfaces:
public final class RequestResultKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any, E extends BadRequestError> RequestResult<T, E>getOrError(CompletableFuture<RequestResult<T, E>> $self)Safely unwraps a CompletableFuture<RequestResult> to a RequestResult. -
-
Method Detail
-
getOrError
final static <T extends Any, E extends BadRequestError> RequestResult<T, E> getOrError(CompletableFuture<RequestResult<T, E>> $self)
Safely unwraps a CompletableFuture<RequestResult> to a RequestResult.
This extension function handles the case where the Future itself fails (as opposed to the request returning an error result). Any exceptions thrown while waiting for the Future are converted to ApplicationError.
- Returns:
The RequestResult from the Future, or ApplicationError if the Future failed to complete normally
-
-
-
-