Exception: SubZero::Client::Error
- Inherits:
-
StandardError
- Object
- StandardError
- SubZero::Client::Error
- Defined in:
- lib/sub_zero/client.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #code ⇒ Object
-
#initialize(response) ⇒ Error
constructor
A new instance of Error.
- #status ⇒ Object
Constructor Details
#initialize(response) ⇒ Error
Returns a new instance of Error.
51 52 53 54 55 56 |
# File 'lib/sub_zero/client.rb', line 51 def initialize response = response.payload['error'].try(:[], 'message') super set_backtrace caller @result = response end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
49 50 51 |
# File 'lib/sub_zero/client.rb', line 49 def result @result end |
Instance Method Details
#code ⇒ Object
58 59 60 |
# File 'lib/sub_zero/client.rb', line 58 def code result.payload['code'] end |
#status ⇒ Object
62 63 64 |
# File 'lib/sub_zero/client.rb', line 62 def status ActiveSupport::StringInquirer.new self.code.to_s.downcase end |