Sha256: bd67309ee929d1a17e651c7fa58906d11eb8ad77dd62b97a96fb503f96625b27

Contents?: true

Size: 526 Bytes

Versions: 8

Compression:

Stored size: 526 Bytes

Contents

module IEX
  module Cloud
    module Response
      class RaiseError < ::Faraday::Response::RaiseError
        def on_complete(env)
          case env[:status]
          when 404
            raise Faraday::ResourceNotFound, response_values(env)
          when 403
            raise IEX::Errors::PermissionDeniedError, response_values(env)
          when ClientErrorStatuses
            raise IEX::Errors::ClientError, response_values(env)
          else
            super
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
iex-ruby-client-2.1.0 lib/iex/cloud/response.rb
iex-ruby-client-2.0.0 lib/iex/cloud/response.rb
iex-ruby-client-1.6.0 lib/iex/cloud/response.rb
iex-ruby-client-1.5.0 lib/iex/cloud/response.rb
iex-ruby-client-1.4.1 lib/iex/cloud/response.rb
iex-ruby-client-1.4.0 lib/iex/cloud/response.rb
iex-ruby-client-1.3.0 lib/iex/cloud/response.rb
iex-ruby-client-1.2.0 lib/iex/cloud/response.rb