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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final IOException getNetworkError() The underlying I/O error that caused the failure
      final Duration getRetryAfter() Optional advisory duration to wait before retrying.
      • Methods inherited from class org.signal.libsignal.net.RequestResult

        map
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RequestResult.RetryableNetworkError

        RequestResult.RetryableNetworkError(IOException networkError, Duration retryAfter)
    • Method Detail

      • 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.