Exception: SSE::Errors::HTTPStatusError
- Inherits:
-
StandardError
- Object
- StandardError
- SSE::Errors::HTTPStatusError
- Defined in:
- lib/ld-eventsource/errors.rb
Overview
An exception class representing an HTTP error response. This can be passed to the error handler specified in Client#on_error.
Instance Attribute Summary collapse
-
#message ⇒ String
readonly
The response body, if any.
-
#status ⇒ Int
readonly
The HTTP status code.
Instance Method Summary collapse
-
#initialize(status, message) ⇒ HTTPStatusError
constructor
A new instance of HTTPStatusError.
Constructor Details
#initialize(status, message) ⇒ HTTPStatusError
Returns a new instance of HTTPStatusError.
12 13 14 15 16 |
# File 'lib/ld-eventsource/errors.rb', line 12 def initialize(status, ) @status = status @message = super("HTTP error #{status}") end |
Instance Attribute Details
#message ⇒ String (readonly)
The response body, if any.
24 25 26 |
# File 'lib/ld-eventsource/errors.rb', line 24 def @message end |
#status ⇒ Int (readonly)
The HTTP status code.
20 21 22 |
# File 'lib/ld-eventsource/errors.rb', line 20 def status @status end |