class Dropbox::Error
Attributes
code[R]
error[R]
url[R]
Public Class Methods
call(env)
click to toggle source
# File lib/rest-core/client/dropbox.rb, line 46 def self.call env error, code, url = env[RESPONSE_BODY], env[RESPONSE_STATUS], env[REQUEST_URI] return new(error, code, url) unless error.kind_of?(Hash) case code when 400; BadRequest when 401; Unauthorized when 403; Forbidden when 404; NotFound when 405; MethodNotAllowed when 503; ServiceUnavailable when 507; OverStorageQuota else ; if code / 100 == 5 Dropbox::Error::ServerError else Dropbox::Error end end.new(error, code, url) end
new(error, code, url='')
click to toggle source
Calls superclass method
# File lib/rest-core/client/dropbox.rb, line 41 def initialize error, code, url='' @error, @code, @url = error, code, url super("[#{code}] #{error.inspect} from #{url}") end