Skip to main content

Error Hierarchy

The Python SDK has a detailed error hierarchy with specific exception types for common HTTP status codes:

Retry Behavior

Automatic retries on 429 and 5xx with exponential backoff and jitter: Strategy: base_delay * 2^attempt * random(0.5, 1.5) (jitter prevents thundering herd) 429 responses: Respects the Retry-After header if present. Non-retryable: 4xx errors (except 429) fail immediately.

Recovery Patterns

Catching specific errors

Rate limit handling

The SDK retries 429 automatically. For custom handling after exhaustion:

Idempotent retries