Sha256: d72b0a2574d17ca707889efcf27b241bd1fd0a1e6792311057fa2fc53b41d411

Contents?: true

Size: 561 Bytes

Versions: 3

Compression:

Stored size: 561 Bytes

Contents

module CoinMarketCap
  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 401, 403
            raise CoinMarketCap::Errors::PermissionDeniedError, response_values(env)
          when ClientErrorStatuses
            raise CoinMarketCap::Errors::ClientError, response_values(env)
          else
            super
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
coinmarketcap-ruby-client-1.1.1 lib/coinmarketcap/cloud/response.rb
coinmarketcap-ruby-client-1.1.0 lib/coinmarketcap/cloud/response.rb
coinmarketcap-ruby-client-1.0.0 lib/coinmarketcap/cloud/response.rb