Sha256: 860099f02b5207d35ad0e492cf019f2e7e11d8e81a3e6849a23a296fa9fecbc5

Contents?: true

Size: 356 Bytes

Versions: 5

Compression:

Stored size: 356 Bytes

Contents

require 'faraday'

require 'cortex/exceptions'

module Cortex
  module FaradayMiddleware
    class ResponseFailures < Faraday::Middleware
      def call(env)
        begin
          @app.call(env)
        rescue Faraday::ConnectionFailed
          raise Cortex::Exceptions::ConnectionFailed.new(base_url: env[:url])
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cortex-client-0.11.0 lib/cortex/faraday_middleware/response_failures.rb
cortex-client-0.10.3 lib/cortex/faraday_middleware/response_failures.rb
cortex-client-0.10.2 lib/cortex/faraday_middleware/response_failures.rb
cortex-client-0.10.1 lib/cortex/faraday_middleware/response_failures.rb
cortex-client-0.10.0 lib/cortex/faraday_middleware/response_failures.rb