Exception: SSE::Errors::HTTPContentTypeError
- Inherits:
-
StandardError
- Object
- StandardError
- SSE::Errors::HTTPContentTypeError
- Defined in:
- lib/ld-eventsource/errors.rb
Overview
An exception class representing an invalid HTTP content type. This can be passed to the error handler specified in Client#on_error.
Instance Attribute Summary collapse
-
#headers ⇒ Hash?
readonly
The HTTP response headers, if any.
-
#type ⇒ String
readonly
The HTTP content type.
Instance Method Summary collapse
-
#initialize(type, headers = nil) ⇒ HTTPContentTypeError
constructor
A new instance of HTTPContentTypeError.
Constructor Details
#initialize(type, headers = nil) ⇒ HTTPContentTypeError
Returns a new instance of HTTPContentTypeError.
40 41 42 43 44 |
# File 'lib/ld-eventsource/errors.rb', line 40 def initialize(type, headers = nil) @content_type = type @headers = headers super("invalid content type \"#{type}\"") end |
Instance Attribute Details
#headers ⇒ Hash? (readonly)
The HTTP response headers, if any.
The headers object uses case-insensitive keys (via the http gem’s HTTP::Headers).
55 56 57 |
# File 'lib/ld-eventsource/errors.rb', line 55 def headers @headers end |
#type ⇒ String (readonly)
The HTTP content type.
48 49 50 |
# File 'lib/ld-eventsource/errors.rb', line 48 def type @type end |