Sha256: 0d57dabc8fce5c481137bf4e57cb5392d0991172cb48ac61988a2dd7901f1244

Contents?: true

Size: 421 Bytes

Versions: 7

Compression:

Stored size: 421 Bytes

Contents

# frozen_string_literal: true

module Dor
  module Services
    class Client
      # This wraps any faraday connection errors with dor-service-client errors
      class ErrorFaradayMiddleware < Faraday::Response::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

7 entries across 7 versions & 1 rubygems

Version Path
dor-services-client-1.11.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-1.10.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-1.9.2 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-1.9.1 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-1.9.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-1.8.0 lib/dor/services/client/error_faraday_middleware.rb
dor-services-client-1.7.0 lib/dor/services/client/error_faraday_middleware.rb