Class RequestResult.RetryableNetworkError
-
- All Implemented Interfaces:
-
org.signal.libsignal.net.RequestResult
public final class RequestResult.RetryableNetworkError implements RequestResult<Nothing, Nothing>
A retryable network failure occurred before receiving a response.
This includes connection failures, timeouts, server errors, and rate limiting. Callers may retry these requests, optionally after a delay.
Possible types for networkError include but are not limited to:
TimeoutException: occurs when the request takes too long to complete.
ConnectedElsewhereException: occurs when a client connects elsewhere with same credentials before the request could complete
ConnectionInvalidatedException: occurs when the connection to the server is invalidated (e.g. the account is deleted) before the request could complete
RetryLaterException: occurs when the client hits a rate limit, and must wait at least the duration specified before retrying. retryAfter will always be set with this error
TransportFailureException: occurs when the transport layer fails
ServerSideErrorException: occurs when the server returns a response indicating a server-side error occurred. You may wish to retry with an especially long timeout on critical paths, like message sending, to avoid worsening a server outage.
-
-
Field Summary
Fields Modifier and Type Field Description private final IOExceptionnetworkErrorprivate final DurationretryAfter
-
Constructor Summary
Constructors Constructor Description RequestResult.RetryableNetworkError(IOException networkError, Duration retryAfter)
-
Method Summary
Modifier and Type Method Description final IOExceptiongetNetworkError()The underlying I/O error that caused the failure final DurationgetRetryAfter()Optional advisory duration to wait before retrying. -
-
Constructor Detail
-
RequestResult.RetryableNetworkError
RequestResult.RetryableNetworkError(IOException networkError, Duration retryAfter)
-
-
Method Detail
-
getNetworkError
final IOException getNetworkError()
The underlying I/O error that caused the failure
-
getRetryAfter
final Duration getRetryAfter()
Optional advisory duration to wait before retrying. If present, the client should not retry before this duration elapses, but may choose to wait longer.
-
-
-
-