Sha256: fd5cef26e02a81aca8365b24b8e5e85b0fe7fb06d544ac9984bf2f30b3aaa2a0

Contents?: true

Size: 465 Bytes

Versions: 6

Compression:

Stored size: 465 Bytes

Contents

require 'faraday'
require 'smartsheet/error'

module Smartsheet
  module API
    module Middleware
      # Raises Faraday request errors as {Smartsheet::RequestError RequestErrors}
      class FaradayErrorTranslator < Faraday::Middleware
        def initialize(app)
          super(app)
        end

        def call(env)
          @app.call(env)
        rescue Faraday::Error => e
          raise Smartsheet::RequestError, e
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
smartsheet-2.101.1 lib/smartsheet/api/faraday_adapter/middleware/faraday_error_translator.rb
smartsheet-2.101.0 lib/smartsheet/api/faraday_adapter/middleware/faraday_error_translator.rb
smartsheet-2.86.1 lib/smartsheet/api/faraday_adapter/middleware/faraday_error_translator.rb
smartsheet-2.86.0 lib/smartsheet/api/faraday_adapter/middleware/faraday_error_translator.rb
smartsheet-2.77.2 lib/smartsheet/api/faraday_adapter/middleware/faraday_error_translator.rb
smartsheet-1.0.0 lib/smartsheet/api/faraday_adapter/middleware/faraday_error_translator.rb