Class: Protocol::HTTP2::Error
- Inherits:
-
HTTP::Error
- Object
- HTTP::Error
- Protocol::HTTP2::Error
- Defined in:
- lib/protocol/http2/error.rb
Overview
Status codes as defined by https://tools.ietf.org/html/rfc7540#section-7.
Direct Known Subclasses
Constant Summary collapse
- NO_ERROR =
The associated condition is not a result of an error. For example, a GOAWAY might include this code to indicate graceful shutdown of a connection.
0x0- PROTOCOL_ERROR =
The endpoint detected an unspecific protocol error. This error is for use when a more specific error code is not available.
0x1- INTERNAL_ERROR =
The endpoint encountered an unexpected internal error.
0x2- FLOW_CONTROL_ERROR =
The endpoint detected that its peer violated the flow-control protocol.
0x3- SETTINGS_TIMEOUT =
The endpoint sent a SETTINGS frame but did not receive a response in a timely manner.
0x4- STREAM_CLOSED =
The endpoint received a frame after a stream was half-closed.
0x5- FRAME_SIZE_ERROR =
The endpoint received a frame with an invalid size.
0x6- REFUSED_STREAM =
The endpoint refused the stream prior to performing any application processing.
0x7- CANCEL =
Used by the endpoint to indicate that the stream is no longer needed.
0x8- COMPRESSION_ERROR =
The endpoint is unable to maintain the header compression context for the connection.
0x9- CONNECT_ERROR =
The connection established in response to a CONNECT request was reset or abnormally closed.
0xA- ENHANCE_YOUR_CALM =
The endpoint detected that its peer is exhibiting a behavior that might be generating excessive load.
0xB- INADEQUATE_SECURITY =
The underlying transport has properties that do not meet minimum security requirements.
0xC- HTTP_1_1_REQUIRED =
The endpoint requires that HTTP/1.1 be used instead of HTTP/2.
0xD- MESSAGES =
{ NO_ERROR => "No error.", PROTOCOL_ERROR => "Protocol error!", INTERNAL_ERROR => "Internal error!", FLOW_CONTROL_ERROR => "Flow control error!", SETTINGS_TIMEOUT => "Settings timeout!", STREAM_CLOSED => "Stream closed!", FRAME_SIZE_ERROR => "Frame size error!", REFUSED_STREAM => "Stream refused.", CANCEL => "Stream cancelled.", COMPRESSION_ERROR => "Compression error!", CONNECT_ERROR => "Connect error!", ENHANCE_YOUR_CALM => "Enhance your calm!", INADEQUATE_SECURITY => "Inadequate security!", HTTP_1_1_REQUIRED => "HTTP/1.1 required.", }
Class Method Summary collapse
-
.message_for(code) ⇒ Object
Get the message for a given HTTP/2 error code.
Class Method Details
.message_for(code) ⇒ Object
Get the message for a given HTTP/2 error code.
74 75 76 77 78 79 |
# File 'lib/protocol/http2/error.rb', line 74 def self.(code) return MESSAGES.fetch(code) do # Unknown error codes are allowed by the protocol, but don't have a static message. "Unknown code: #{code}!" end end |