RpcFailureMode

Documentation for eth_defi.provider.rpc_failure.RpcFailureMode Python class.

class RpcFailureMode

Bases: enum.Enum

Coarse, stable classification of an upstream JSON-RPC failure.

Values are snake_case strings safe to log, aggregate and grep in CI output.

Attributes summary

out_of_credits

Provider rejected the request for billing/quota reasons (HTTP 402, or a message mentioning credits/compute units/quota/plan limits).

rate_limited

Provider throttled the request (HTTP 429, "too many requests", throttling).

read_timeout

The request exceeded its read timeout (requests ReadTimeout / Timeout).

connection_error

Could not establish or keep a connection (refused, reset, DNS, pool).

server_error

Upstream returned a 5xx (bad gateway, service unavailable, gateway timeout).

bad_response

A response arrived but was malformed / not valid JSON-RPC.

unknown

Nothing matched — do not guess.

out_of_credits = 'out_of_credits'

Provider rejected the request for billing/quota reasons (HTTP 402, or a message mentioning credits/compute units/quota/plan limits).

rate_limited = 'rate_limited'

Provider throttled the request (HTTP 429, “too many requests”, throttling).

read_timeout = 'read_timeout'

The request exceeded its read timeout (requests ReadTimeout / Timeout).

connection_error = 'connection_error'

Could not establish or keep a connection (refused, reset, DNS, pool).

server_error = 'server_error'

Upstream returned a 5xx (bad gateway, service unavailable, gateway timeout).

bad_response = 'bad_response'

A response arrived but was malformed / not valid JSON-RPC.

unknown = 'unknown'

Nothing matched — do not guess.