Enum Class ErrorCode

java.lang.Object
java.lang.Enum<ErrorCode>
io.github.mahmoudimus.http2.ErrorCode
All Implemented Interfaces:
Serializable, Comparable<ErrorCode>, Constable

public enum ErrorCode extends Enum<ErrorCode>
The error codes of RFC 9113 §7, carried by RST_STREAM and GOAWAY frames.
  • Enum Constant Details

    • NO_ERROR

      public static final ErrorCode NO_ERROR
      Graceful completion without an error.
    • PROTOCOL_ERROR

      public static final ErrorCode PROTOCOL_ERROR
      A violation of the HTTP/2 protocol.
    • INTERNAL_ERROR

      public static final ErrorCode INTERNAL_ERROR
      An unexpected internal failure.
    • FLOW_CONTROL_ERROR

      public static final ErrorCode FLOW_CONTROL_ERROR
      A violation of flow-control limits.
    • SETTINGS_TIMEOUT

      public static final ErrorCode SETTINGS_TIMEOUT
      A SETTINGS acknowledgement took too long.
    • STREAM_CLOSED

      public static final ErrorCode STREAM_CLOSED
      A frame arrived for a closed stream.
    • FRAME_SIZE_ERROR

      public static final ErrorCode FRAME_SIZE_ERROR
      A frame payload has an invalid size.
    • REFUSED_STREAM

      public static final ErrorCode REFUSED_STREAM
      The stream was refused before application processing.
    • CANCEL

      public static final ErrorCode CANCEL
      The stream is no longer needed.
    • COMPRESSION_ERROR

      public static final ErrorCode COMPRESSION_ERROR
      The HPACK compression state is invalid.
    • CONNECT_ERROR

      public static final ErrorCode CONNECT_ERROR
      The connection established by CONNECT failed.
    • ENHANCE_YOUR_CALM

      public static final ErrorCode ENHANCE_YOUR_CALM
      The peer is generating excessive load.
    • INADEQUATE_SECURITY

      public static final ErrorCode INADEQUATE_SECURITY
      The connection does not meet security requirements.
    • HTTP_1_1_REQUIRED

      public static final ErrorCode HTTP_1_1_REQUIRED
      The peer requires HTTP/1.1 instead.
  • Method Details

    • values

      public static ErrorCode[] 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 ErrorCode 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
    • code

      public int code()
      The 32-bit value sent on the wire.
      Returns:
      the raw 32-bit error code
    • forCode

      public static ErrorCode forCode(int code)
      The error code for a wire value. Unknown codes must not trigger special behaviour (RFC 9113 §7), so they map to INTERNAL_ERROR.
      Parameters:
      code - the raw wire error code
      Returns:
      the matching code, or INTERNAL_ERROR if unknown