Enum Class Http3ErrorCode

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

public enum Http3ErrorCode extends Enum<Http3ErrorCode>
The HTTP/3 error codes (RFC 9114 §8.1), the QPACK error codes (RFC 9204 §6) and H3_DATAGRAM_ERROR (RFC 9297 §5.2). QUIC carries them: CONNECTION_CLOSE for a connection error, RESET_STREAM and STOP_SENDING for a stream error.
  • Enum Constant Details

    • H3_DATAGRAM_ERROR

      public static final Http3ErrorCode H3_DATAGRAM_ERROR
      An HTTP Datagram or the Capsule Protocol was misused (RFC 9297 §5.2).
    • H3_NO_ERROR

      public static final Http3ErrorCode H3_NO_ERROR
      No error: the connection or stream is closing without one.
    • H3_GENERAL_PROTOCOL_ERROR

      public static final Http3ErrorCode H3_GENERAL_PROTOCOL_ERROR
      A protocol violation no more specific code covers.
    • H3_INTERNAL_ERROR

      public static final Http3ErrorCode H3_INTERNAL_ERROR
      An internal error in the HTTP stack.
    • H3_STREAM_CREATION_ERROR

      public static final Http3ErrorCode H3_STREAM_CREATION_ERROR
      The peer created a stream that will not be accepted.
    • H3_CLOSED_CRITICAL_STREAM

      public static final Http3ErrorCode H3_CLOSED_CRITICAL_STREAM
      A stream the connection needs was closed or reset.
    • H3_FRAME_UNEXPECTED

      public static final Http3ErrorCode H3_FRAME_UNEXPECTED
      A frame not permitted in the current state or on the current stream.
    • H3_FRAME_ERROR

      public static final Http3ErrorCode H3_FRAME_ERROR
      A frame that fails its layout requirements, or of the wrong size.
    • H3_EXCESSIVE_LOAD

      public static final Http3ErrorCode H3_EXCESSIVE_LOAD
      The peer is generating excessive load.
    • H3_ID_ERROR

      public static final Http3ErrorCode H3_ID_ERROR
      A stream or push identifier was used incorrectly.
    • H3_SETTINGS_ERROR

      public static final Http3ErrorCode H3_SETTINGS_ERROR
      An error in the payload of a SETTINGS frame.
    • H3_MISSING_SETTINGS

      public static final Http3ErrorCode H3_MISSING_SETTINGS
      No SETTINGS frame at the start of the control stream.
    • H3_REQUEST_REJECTED

      public static final Http3ErrorCode H3_REQUEST_REJECTED
      The server rejected a request without processing any of it.
    • H3_REQUEST_CANCELLED

      public static final Http3ErrorCode H3_REQUEST_CANCELLED
      The request or its response is cancelled.
    • H3_REQUEST_INCOMPLETE

      public static final Http3ErrorCode H3_REQUEST_INCOMPLETE
      The client's stream ended without a complete request.
    • H3_MESSAGE_ERROR

      public static final Http3ErrorCode H3_MESSAGE_ERROR
      A malformed HTTP message.
    • H3_CONNECT_ERROR

      public static final Http3ErrorCode H3_CONNECT_ERROR
      The connection of a CONNECT request was reset or closed abnormally.
    • H3_VERSION_FALLBACK

      public static final Http3ErrorCode H3_VERSION_FALLBACK
      The request should be retried over HTTP/1.1.
    • QPACK_DECOMPRESSION_FAILED

      public static final Http3ErrorCode QPACK_DECOMPRESSION_FAILED
      A field section could not be decoded (RFC 9204 §6).
    • QPACK_ENCODER_STREAM_ERROR

      public static final Http3ErrorCode QPACK_ENCODER_STREAM_ERROR
      An instruction on the encoder stream could not be processed.
    • QPACK_DECODER_STREAM_ERROR

      public static final Http3ErrorCode QPACK_DECODER_STREAM_ERROR
      An instruction on the decoder stream could not be processed.
  • Method Details

    • values

      public static Http3ErrorCode[] 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 Http3ErrorCode 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 long code()
      The value sent on the wire, a variable-length integer.
      Returns:
      the wire value
    • forCode

      public static Http3ErrorCode forCode(long code)
      The error code for a wire value. Unknown codes, including the reserved ones, must be treated as H3_NO_ERROR (RFC 9114 §9).
      Parameters:
      code - the wire value
      Returns:
      its error code, or H3_NO_ERROR for an unknown one
    • isReserved

      public static boolean isReserved(long code)
      Whether code is a reserved (greasing) error code, 0x1f * N + 0x21 (RFC 9114 §8.1).
      Parameters:
      code - the wire value
      Returns:
      whether it is reserved