Exception: Watchfor::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Watchfor::Error
- 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
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, code, message) ⇒ Error
constructor
A new instance of Error.
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, ) @status = status @code = code super("[#{status}] #{code}: #{}") end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
13 14 15 |
# File 'lib/watchfor/client.rb', line 13 def code @code end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
13 14 15 |
# File 'lib/watchfor/client.rb', line 13 def status @status end |