Exception: GoogleR::Error

Inherits:
Exception
  • Object
show all
Defined in:
lib/google_r/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, response) ⇒ Error

Returns a new instance of Error.



5
6
7
# File 'lib/google_r/exceptions.rb', line 5

def initialize(status, response)
  @status, @response = status, response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/google_r/exceptions.rb', line 3

def response
  @response
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/google_r/exceptions.rb', line 3

def status
  @status
end

Instance Method Details

#messageObject



9
10
11
12
13
14
# File 'lib/google_r/exceptions.rb', line 9

def message
  [
    "Response code: #{@status}",
    "Response body: #{@response}",
  ].join("\n")
end