Exception: Watchfor::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/watchfor/client.rb

Overview

Raised when the API returns a non-2xx response. Carries the HTTP status and the API's structured code and message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, code, message) ⇒ Error

Returns a new instance of Error.



15
16
17
18
19
# File 'lib/watchfor/client.rb', line 15

def initialize(status, code, message)
  @status = status
  @code = code
  super("[#{status}] #{code}: #{message}")
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



13
14
15
# File 'lib/watchfor/client.rb', line 13

def code
  @code
end

#statusObject (readonly)

Returns the value of attribute status.



13
14
15
# File 'lib/watchfor/client.rb', line 13

def status
  @status
end