Sha256: 6fa728447c76921fe3533aebe953a5b5d7a11bfa52dd02cb7e6836311984b517

Contents?: true

Size: 482 Bytes

Versions: 17

Compression:

Stored size: 482 Bytes

Contents

class Epics::ParseEbics < Faraday::Middleware

  def initialize(app = nil, options = {})
    super(app)
    @client = options[:client]
  end

  def call(env)
    @app.call(env).on_complete do |env|
      env[:body] = ::Epics::Response.new(@client, env[:body])
      raise Epics::Error::TechnicalError.new(env[:body].technical_code) if env[:body].technical_error?
      raise Epics::Error::BusinessError.new(env[:body].business_code)  if env[:body].business_error?
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
epics-1.7.1 lib/epics/middleware/parse_ebics.rb
epics-1.7.0 lib/epics/middleware/parse_ebics.rb
epics-1.6.0 lib/epics/middleware/parse_ebics.rb
epics-1.5.2 lib/epics/middleware/parse_ebics.rb
epics-1.5.1 lib/epics/middleware/parse_ebics.rb
epics-1.5.0 lib/epics/middleware/parse_ebics.rb
epics-1.4.1 lib/epics/middleware/parse_ebics.rb
epics-1.4.0 lib/epics/middleware/parse_ebics.rb
epics-1.3.1 lib/epics/middleware/parse_ebics.rb
epics-1.3.0 lib/epics/middleware/parse_ebics.rb
epics-1.2.2 lib/epics/middleware/parse_ebics.rb
epics-1.2.1 lib/epics/middleware/parse_ebics.rb
epics-1.2.0 lib/epics/middleware/parse_ebics.rb
epics-1.1.2 lib/epics/middleware/parse_ebics.rb
epics-1.1.1 lib/epics/middleware/parse_ebics.rb
epics-1.1.0 lib/epics/middleware/parse_ebics.rb
epics-1.0.0 lib/epics/middleware/parse_ebics.rb