Exception: SSE::Errors::HTTPStatusError

Inherits:
StandardError
  • Object
show all
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

Instance Method Summary collapse

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, message)
  @status = status
  @message = message
  super("HTTP error #{status}")
end

Instance Attribute Details

#messageString (readonly)

The response body, if any.

Returns:

  • (String)


24
25
26
# File 'lib/ld-eventsource/errors.rb', line 24

def message
  @message
end

#statusInt (readonly)

The HTTP status code.

Returns:

  • (Int)


20
21
22
# File 'lib/ld-eventsource/errors.rb', line 20

def status
  @status
end