Sha256: a29909204108ea4c046ebf16fa2cc2e669dbd313f1f52ce7f57a8671e05db2d5

Contents?: true

Size: 412 Bytes

Versions: 43

Compression:

Stored size: 412 Bytes

Contents

# frozen_string_literal: true

module Dor
  module Services
    class Client
      # This wraps any faraday connection errors with dor-services-client errors
      class ErrorFaradayMiddleware < Faraday::Middleware
        def call(env)
          @app.call(env)
        rescue Faraday::ConnectionFailed
          raise ConnectionFailed, 'unable to reach dor-services-app'
        end
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
dor-services-client-12.4.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.3.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.2.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.1.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.0.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-11.0.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-10.2.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-10.1.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-10.0.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-9.1.1 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-9.1.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-9.0.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-8.9.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-8.8.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-8.7.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-8.6.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-8.5.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-8.4.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-8.3.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-8.2.0 lib/dor/services/client/error_faraday_middleware.rb