Exception: GoogleDrive::ResponseCodeError

Inherits:
Error
  • Object
show all
Defined in:
lib/google_drive/response_code_error.rb

Overview

Raised when an HTTP request has returned an unexpected response code.

Direct Known Subclasses

AuthenticationError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, body, method, url) ⇒ ResponseCodeError

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ResponseCodeError.



12
13
14
15
16
17
18
19
# File 'lib/google_drive/response_code_error.rb', line 12

def initialize(code, body, method, url)
  @code = code
  @body = body
  super(format(
    'Response code %s for %s %s: %s',
    code, method, url, CGI.unescapeHTML(body)
  ))
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



21
22
23
# File 'lib/google_drive/response_code_error.rb', line 21

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



21
22
23
# File 'lib/google_drive/response_code_error.rb', line 21

def code
  @code
end