Exception: Http::ParserError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Http::ParserError
- Defined in:
- lib/http/parser.rb
Overview
An exception class for HTTP parser errors. Includes an HTTP Error Code number that corresponds to the difficulty parsing (ie. 414 for Request-URI Too Long)
Direct Known Subclasses
BadRequest, LengthRequired, NotImplemented, RequestEntityTooLarge, RequestTimeout, RequestURITooLong
Defined Under Namespace
Classes: BadRequest, LengthRequired, NotImplemented, RequestEntityTooLarge, RequestTimeout, RequestURITooLong
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
The error code that corresponds to the parsing error.
-
#headers ⇒ Object
readonly
Headers that should be sent back with the error reply as a hash.
Instance Method Summary collapse
-
#initialize(string = "Bad Request", code = 400, headers = {}) ⇒ ParserError
constructor
A new instance of ParserError.
Constructor Details
#initialize(string = "Bad Request", code = 400, headers = {}) ⇒ ParserError
Returns a new instance of ParserError.
19 20 21 22 23 |
# File 'lib/http/parser.rb', line 19 def initialize(string = "Bad Request", code = 400, headers = {}) super(string) @code = code @headers = headers end |
Instance Attribute Details
#code ⇒ Object (readonly)
The error code that corresponds to the parsing error.
15 16 17 |
# File 'lib/http/parser.rb', line 15 def code @code end |
#headers ⇒ Object (readonly)
Headers that should be sent back with the error reply as a hash.
17 18 19 |
# File 'lib/http/parser.rb', line 17 def headers @headers end |