Exception: TeslaAPI::Errors::InvalidResponse

Inherits:
StandardError
  • Object
show all
Defined in:
lib/tesla-api/errors.rb

Overview

Thrown when the response is invalid (non 200-OK HTTP result)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ InvalidResponse

Returns a new instance of InvalidResponse.



31
32
33
# File 'lib/tesla-api/errors.rb', line 31

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Response object from httpclient



29
30
31
# File 'lib/tesla-api/errors.rb', line 29

def response
  @response
end

Instance Method Details

#to_sObject



35
36
37
# File 'lib/tesla-api/errors.rb', line 35

def to_s
  "Invalid Response: #{response.inspect}"
end