Exception: CloudApp::ResponseError
- Inherits:
-
StandardError
- Object
- StandardError
- CloudApp::ResponseError
- Defined in:
- lib/cloudapp/response_error.rb
Overview
Error raised on a bad response
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(res) ⇒ CloudApp::ResponseError
constructor
Instantiate an instance of CloudApp::ResponseError.
-
#to_s ⇒ String
Returns error code and message.
Constructor Details
#initialize(res) ⇒ CloudApp::ResponseError
Instantiate an instance of CloudApp::ResponseError
Only used internally
14 15 16 17 18 |
# File 'lib/cloudapp/response_error.rb', line 14 def initialize(res) @response = res.response @code = res.code @errors = parse_errors(res.parsed_response) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'lib/cloudapp/response_error.rb', line 6 def code @code end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'lib/cloudapp/response_error.rb', line 6 def errors @errors end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/cloudapp/response_error.rb', line 6 def response @response end |
Instance Method Details
#to_s ⇒ String
Returns error code and message
23 24 25 |
# File 'lib/cloudapp/response_error.rb', line 23 def to_s "#{code.to_s} #{response.msg}".strip end |