Enum Class HttpTransportErrorKind

java.lang.Object
java.lang.Enum<HttpTransportErrorKind>
com.hedera.hashgraph.sdk.HttpTransportErrorKind
All Implemented Interfaces:
Serializable, Comparable<HttpTransportErrorKind>, Constable

public enum HttpTransportErrorKind extends Enum<HttpTransportErrorKind>
The stable identifiers an HttpTransport fails with.

These are the same seven identifiers in every Hiero SDK, so a test asserting on one asserts the same thing in every language. The second property of each is whether repeating the exchange can help: without it a mistyped host name would cost the whole attempt budget before an obvious error surfaced, and certificate validation would be re-run purely to burn attempts.

A transport failure that cannot be classified as one of these is treated as non-retryable. That is the safe direction: a wrongly terminal error surfaces a visible failure after one attempt, while a wrongly retryable one costs the whole budget and hides the cause.

  • Enum Constant Details

    • CONNECTION_ERROR

      public static final HttpTransportErrorKind CONNECTION_ERROR
      The connection was refused, reset, or the peer was unreachable. Retryable.
    • TIMEOUT_ERROR

      public static final HttpTransportErrorKind TIMEOUT_ERROR
      The per-attempt deadline elapsed. Retryable.
    • UNKNOWN_HOST_ERROR

      public static final HttpTransportErrorKind UNKNOWN_HOST_ERROR
      The host name does not resolve.

      Every name resolution failure maps here, including a transient SERVFAIL: UnknownHostException carries no code and no fields, so one SDK cannot tell a permanent failure from a temporary one. Not retryable.

    • TLS_ERROR

      public static final HttpTransportErrorKind TLS_ERROR
      Certificate verification or the TLS handshake failed. Not retryable.
    • CLIENT_CLOSED_ERROR

      public static final HttpTransportErrorKind CLIENT_CLOSED_ERROR
      The transport was closed. Not retryable.
    • CANCELLED_ERROR

      public static final HttpTransportErrorKind CANCELLED_ERROR
      The caller cancelled the call. Not retryable.
    • RESPONSE_TOO_LARGE_ERROR

      public static final HttpTransportErrorKind RESPONSE_TOO_LARGE_ERROR
      The response body exceeded HttpTransportConfiguration.getMaxResponseBytes(). Not retryable.
    • RETRIES_EXHAUSTED_ERROR

      public static final HttpTransportErrorKind RETRIES_EXHAUSTED_ERROR
      A retryable status survived every attempt.

      Raised by the mirror node REST adapter rather than by a transport, and distinct from DEADLINE_EXCEEDED_ERROR: a node failing repeatedly is not the clock running out.

    • DEADLINE_EXCEEDED_ERROR

      public static final HttpTransportErrorKind DEADLINE_EXCEEDED_ERROR
      The call's total deadline elapsed, or an honoured Retry-After exceeded the time left in it.

      Raised by the mirror node REST adapter rather than by a transport.

  • Method Details

    • values

      public static HttpTransportErrorKind[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static HttpTransportErrorKind valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getId

      public String getId()
      Extract the cross-SDK identifier, such as "connection-error".
      Returns:
      the identifier
    • isRetryable

      public boolean isRetryable()
      Whether repeating the exchange can help.
      Returns:
      true if the failure is retryable
    • toString

      public String toString()
      Overrides:
      toString in class Enum<HttpTransportErrorKind>