Exception: Dropbox::APIError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/dropbox/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#messageObject (readonly)

Returns the value of attribute message.



25
26
27
# File 'lib/dropbox/errors.rb', line 25

def message
  @message
end

Instance Method Details

#to_sObject



35
36
37
# File 'lib/dropbox/errors.rb', line 35

def to_s
  @message.to_s
end