Sha256: 4fb1ea88e846a75b066226468037379baa63003fc5e5286d358b3fb499485dbb

Contents?: true

Size: 485 Bytes

Versions: 4

Compression:

Stored size: 485 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

4 entries across 4 versions & 1 rubygems

Version Path
smartsheet-2.77.0 lib/smartsheet/api/faraday_adapter/middleware/faraday_error_translator.rb
smartsheet-1.3.0 lib/smartsheet/api/faraday_adapter/middleware/faraday_error_translator.rb
smartsheet-1.2.0 lib/smartsheet/api/faraday_adapter/middleware/faraday_error_translator.rb
smartsheet-1.1.0 lib/smartsheet/api/faraday_adapter/middleware/faraday_error_translator.rb