lib/ecwid_api/api.rb
def raise_on_failure(response)
      if response.success?
        yield(response) if block_given?
      else
        raise ResponseError.new(response)
      end
    end
# Private: Raises an Error if a request failed, otherwise it will
# yield the block
#
# response - a Faraday::Response object
#
# Yield if the response was successful
#
# Raises an error with the status code and reason if the response failed
#
Raises an Error if a request failed, otherwise it will
yield the block

a Faraday::Response object

Yield if the response was successful

Raises an error with the status code and reason if the response failed
Raises an Error if a request failed otherwise it will yield the block a Faraday :: Response object Yield if the response was successful Raises an error with the status code and reason if the response failed
def raise_on_failure(response)
      if response.success?
        yield(response) if block_given?
      else
        raise ResponseError.new(response)
      end
    end
def raise_on_failure ( response ) if response . success? yield ( response ) if block_given? else raise ResponseError . new ( response ) end end
Private: Raises an Error if a request failed, otherwise it will
yield the block
Private : Raises an Error if a request failed otherwise it will yield the block
response