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-13.1.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-13.0.1 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-13.0.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.18.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.17.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.16.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.15.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.14.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.13.1 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.13.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.12.1 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.12.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.11.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.10.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.9.1 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.9.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.8.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.7.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.6.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-12.5.0 lib/dor/services/client/error_faraday_middleware.rb