Sha256: 788f61cdc0d8a02220af4309d679020077e3e4b314741a7da56afc6fdcb11fad

Contents?: true

Size: 551 Bytes

Versions: 8

Compression:

Stored size: 551 Bytes

Contents

# frozen_string_literal: true

# IronBank main module
module IronBank
  # IronBank Faraday middleware module
  module FaradayMiddleware
    # IronBank Faraday response middleware module
    module Response
      # This class raises an exception based on the HTTP status code and the
      # `success` flag (if present in the response) from Zuora.
      class RaiseError < Faraday::Response::Middleware
        def on_complete(env)
          (error = IronBank::Error.from_response(env.response)) && raise(error)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
iron_bank-5.4.1 lib/iron_bank/faraday_middleware/response/raise_error.rb
iron_bank-5.4.0 lib/iron_bank/faraday_middleware/response/raise_error.rb
iron_bank-5.3.2 lib/iron_bank/faraday_middleware/response/raise_error.rb
iron_bank-5.3.0 lib/iron_bank/faraday_middleware/response/raise_error.rb
iron_bank-5.2.6 lib/iron_bank/faraday_middleware/response/raise_error.rb
iron_bank-5.2.4 lib/iron_bank/faraday_middleware/response/raise_error.rb
iron_bank-5.2.3 lib/iron_bank/faraday_middleware/response/raise_error.rb
iron_bank-5.2.0 lib/iron_bank/faraday_middleware/response/raise_error.rb