lib/ecwid_api/client.rb
# Private: Raises a ResponseError if the request failed
#
# response - a Faraday::Response object that is the result of a request
#
# Raises ResponseError if the request wasn't successful
#
# Returns the original response if the request was successful
#
#
Raises a ResponseError if the request failed
response - a Faraday::Response object that is the result of a request

Raises ResponseError if the request wasn't successful

Returns the original response if the request was successful
Raises a ResponseError if the request failed response - a Faraday :: Response object that is the result of a request Raises ResponseError if the request wasn ' t successful Returns the original response if the request was successful
def raise_on_failure(response)
      if response.success?
        if response.body.is_a?(Hash) && response.body["updateCount"] &&
           response.body["updateCount"] != 1
          raise UpdateError.new(response)
        end
        response
      else
        raise ResponseError.new(response)
      end
    end
def raise_on_failure ( response ) if response . success? if response . body . is_a? ( Hash ) && response . body [ "updateCount" ] && response . body [ "updateCount" ] != 1 raise UpdateError . new ( response ) end response else raise ResponseError . new ( response ) end end
Private: Raises a ResponseError if the request failed
response - a Faraday::Response object that is the result of a request
Private : Raises a ResponseError if the request failed response - a Faraday :: Response object that is the result of a request
response