Exception: Scaleway::APIError
- Inherits:
-
Exception
- Object
- Exception
- Scaleway::APIError
- Defined in:
- lib/scaleway.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#error_message ⇒ Object
Returns the value of attribute error_message.
-
#status ⇒ Object
Returns the value of attribute status.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(response) ⇒ APIError
constructor
A new instance of APIError.
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ APIError
Returns a new instance of APIError.
307 308 309 310 311 312 |
# File 'lib/scaleway.rb', line 307 def initialize(response) self.status = response.status self.body = RecursiveOpenStruct.new(response.body, :recurse_over_arrays => true) self.type = self.body.type self. = self.body. end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
325 326 327 |
# File 'lib/scaleway.rb', line 325 def body @body end |
#error_message ⇒ Object
Returns the value of attribute error_message.
324 325 326 |
# File 'lib/scaleway.rb', line 324 def end |
#status ⇒ Object
Returns the value of attribute status.
322 323 324 |
# File 'lib/scaleway.rb', line 322 def status @status end |
#type ⇒ Object
Returns the value of attribute type.
323 324 325 |
# File 'lib/scaleway.rb', line 323 def type @type end |
Instance Method Details
#message ⇒ Object
318 319 320 |
# File 'lib/scaleway.rb', line 318 def "#{self}" end |
#to_s ⇒ Object
314 315 316 |
# File 'lib/scaleway.rb', line 314 def to_s "<status:#{status}, type:#{type}, message:\'#{error_message}\'>" end |