Sha256: af9c5f02e6e5cc8c7a56ee523677412d590cbeaa8c0f7e481962dd8aff8d00c2

Contents?: true

Size: 436 Bytes

Versions: 4

Compression:

Stored size: 436 Bytes

Contents

# frozen_string_literal: true

module IronBank
  # Faraday response middleware
  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
      private

      def on_complete(response)
        (error = IronBank::Error.from_response(response)) && raise(error)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
iron_bank-1.0.2 lib/iron_bank/response/raise_error.rb
iron_bank-1.0.1 lib/iron_bank/response/raise_error.rb
iron_bank-1.0.0 lib/iron_bank/response/raise_error.rb
iron_bank-0.7.1 lib/iron_bank/response/raise_error.rb