Exception: Dropbox::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- Dropbox::APIError
- Defined in:
- lib/dropbox/errors.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(response) ⇒ APIError
constructor
A new instance of APIError.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ APIError
Returns a new instance of APIError.
27 28 29 30 31 32 33 |
# File 'lib/dropbox/errors.rb', line 27 def initialize(response) if response.content_type.mime_type == 'application/json' @message = JSON.parse(response)['error_summary'] else @message = response end end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
25 26 27 |
# File 'lib/dropbox/errors.rb', line 25 def @message end |
Instance Method Details
#to_s ⇒ Object
35 36 37 |
# File 'lib/dropbox/errors.rb', line 35 def to_s @message.to_s end |