Exception: EcwidApi::ResponseError

Inherits:
Error
  • Object
show all
Defined in:
lib/ecwid_api/error.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ResponseError

Returns a new instance of ResponseError.



5
6
7
8
9
10
11
# File 'lib/ecwid_api/error.rb', line 5

def initialize(response)
  if response.respond_to?(:reason_phrase)
    super "#{response.reason_phrase} (#{response.status})\n#{response.body}"
  else
    super "The Ecwid API responded with an error (#{response.status})"
  end
end