Sha256: d054ffa255630e76b000fcd3a1db9bd6d3d63d3835300ff2da47d14e0c4cda71

Contents?: true

Size: 533 Bytes

Versions: 5

Compression:

Stored size: 533 Bytes

Contents

module IEX
  module Cloud
    module Response
      class RaiseError < ::Faraday::Response::RaiseError
        def on_complete(env)
          case env[:status]
          when 404
            raise Faraday::Error::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

5 entries across 5 versions & 1 rubygems

Version Path
iex-ruby-client-1.1.2 lib/iex/cloud/response.rb
iex-ruby-client-1.1.1 lib/iex/cloud/response.rb
iex-ruby-client-1.1.0 lib/iex/cloud/response.rb
iex-ruby-client-1.0.1 lib/iex/cloud/response.rb
iex-ruby-client-1.0.0 lib/iex/cloud/response.rb