Package io.github.mahmoudimus.http2
Enum Class ErrorCode
- All Implemented Interfaces:
Serializable,Comparable<ErrorCode>,Constable
The error codes of RFC 9113 §7, carried by RST_STREAM and GOAWAY frames.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe stream is no longer needed.The HPACK compression state is invalid.The connection established by CONNECT failed.The peer is generating excessive load.A violation of flow-control limits.A frame payload has an invalid size.The peer requires HTTP/1.1 instead.The connection does not meet security requirements.An unexpected internal failure.Graceful completion without an error.A violation of the HTTP/2 protocol.The stream was refused before application processing.A SETTINGS acknowledgement took too long.A frame arrived for a closed stream. -
Method Summary
Modifier and TypeMethodDescriptionintcode()The 32-bit value sent on the wire.static ErrorCodeforCode(int code) The error code for a wire value.static ErrorCodeReturns the enum constant of this class with the specified name.static ErrorCode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NO_ERROR
Graceful completion without an error. -
PROTOCOL_ERROR
A violation of the HTTP/2 protocol. -
INTERNAL_ERROR
An unexpected internal failure. -
FLOW_CONTROL_ERROR
A violation of flow-control limits. -
SETTINGS_TIMEOUT
A SETTINGS acknowledgement took too long. -
STREAM_CLOSED
A frame arrived for a closed stream. -
FRAME_SIZE_ERROR
A frame payload has an invalid size. -
REFUSED_STREAM
The stream was refused before application processing. -
CANCEL
The stream is no longer needed. -
COMPRESSION_ERROR
The HPACK compression state is invalid. -
CONNECT_ERROR
The connection established by CONNECT failed. -
ENHANCE_YOUR_CALM
The peer is generating excessive load. -
INADEQUATE_SECURITY
The connection does not meet security requirements. -
HTTP_1_1_REQUIRED
The peer requires HTTP/1.1 instead.
-
-
Method Details
-
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
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 nameNullPointerException- 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
The error code for a wire value. Unknown codes must not trigger special behaviour (RFC 9113 §7), so they map toINTERNAL_ERROR.- Parameters:
code- the raw wire error code- Returns:
- the matching code, or INTERNAL_ERROR if unknown
-