Class: Protocol::HTTP2::ProtocolError
- Defined in:
- lib/protocol/http2/error.rb
Overview
Raised by stream or connection handlers, results in GOAWAY frame which signals termination of the current connection. You cannot recover from this exception, or any exceptions subclassed from it.
Direct Known Subclasses
Constant Summary
Constants inherited from Error
Error::CANCEL, Error::COMPRESSION_ERROR, Error::CONNECT_ERROR, Error::ENHANCE_YOUR_CALM, Error::FLOW_CONTROL_ERROR, Error::FRAME_SIZE_ERROR, Error::HTTP_1_1_REQUIRED, Error::INADEQUATE_SECURITY, Error::INTERNAL_ERROR, Error::MESSAGES, Error::NO_ERROR, Error::PROTOCOL_ERROR, Error::REFUSED_STREAM, Error::SETTINGS_TIMEOUT, Error::STREAM_CLOSED
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Class Method Summary collapse
-
.for(code) ⇒ Object
Build a protocol error for a given HTTP/2 error code.
Instance Method Summary collapse
-
#initialize(message, code = PROTOCOL_ERROR) ⇒ ProtocolError
constructor
Initialize a protocol error with message and error code.
Methods inherited from Error
Constructor Details
#initialize(message, code = PROTOCOL_ERROR) ⇒ ProtocolError
Initialize a protocol error with message and error code.
102 103 104 105 106 |
# File 'lib/protocol/http2/error.rb', line 102 def initialize(, code = PROTOCOL_ERROR) super() @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
108 109 110 |
# File 'lib/protocol/http2/error.rb', line 108 def code @code end |
Class Method Details
.for(code) ⇒ Object
Build a protocol error for a given HTTP/2 error code.
95 96 97 |
# File 'lib/protocol/http2/error.rb', line 95 def self.for(code) return self.new(Error.(code), code) end |