Enum GrpcUtil.Http2Error
- All Implemented Interfaces:
Serializable, Comparable<GrpcUtil.Http2Error>
- Enclosing class:
GrpcUtil
All error codes identified by the HTTP/2 spec. Used in GOAWAY and RST_STREAM frames.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionServers implementing a graceful shutdown of the connection will sendGOAWAYwithNO_ERROR. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate static final GrpcUtil.Http2Error[]private final Status -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static GrpcUtil.Http2Error[]longcode()Gets the code for this error used on the wire.static GrpcUtil.Http2ErrorforCode(long code) Looks up the HTTP/2 error code enum value for the specified code.status()Gets theStatusassociated with this HTTP/2 code.static StatusstatusForCode(long code) Looks up theStatusfrom the given HTTP/2 error code.static GrpcUtil.Http2ErrorReturns the enum constant of this type with the specified name.static GrpcUtil.Http2Error[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NO_ERROR
Servers implementing a graceful shutdown of the connection will sendGOAWAYwithNO_ERROR. In this case it is important to indicate to the application that the request should be retried (i.e.Status.UNAVAILABLE). -
PROTOCOL_ERROR
-
INTERNAL_ERROR
-
FLOW_CONTROL_ERROR
-
SETTINGS_TIMEOUT
-
STREAM_CLOSED
-
FRAME_SIZE_ERROR
-
REFUSED_STREAM
-
CANCEL
-
COMPRESSION_ERROR
-
CONNECT_ERROR
-
ENHANCE_YOUR_CALM
-
INADEQUATE_SECURITY
-
HTTP_1_1_REQUIRED
-
-
Field Details
-
codeMap
-
code
private final int code -
status
-
-
Constructor Details
-
Http2Error
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
buildHttp2CodeMap
-
code
public long code()Gets the code for this error used on the wire. -
status
-
forCode
Looks up the HTTP/2 error code enum value for the specified code.- Parameters:
code- an HTTP/2 error code value.- Returns:
- the HTTP/2 error code enum or
nullif not found.
-
statusForCode
Looks up theStatusfrom the given HTTP/2 error code. This is preferred overforCode(code).status(), to more easily conform to HTTP/2:Unknown or unsupported error codes MUST NOT trigger any special behavior. These MAY be treated by an implementation as being equivalent to INTERNAL_ERROR.
- Parameters:
code- the HTTP/2 error code.- Returns:
- a
Statusrepresenting the given error.
-