Skip to main content
The SDK raises typed exceptions that you can catch and handle.

Error classes

The Python SDK exports:
  • MailGlyphError
  • AuthenticationError
  • ValidationError
  • NotFoundError
  • RateLimitError
  • ApiError

Catch typed errors

Key-type mismatch example

events.track requires a public key and most other methods require a secret key.

Retry and timeout behavior

The SDK automatically retries transient failures:
  • Up to max_retries retries (default 3)
  • Retries 429 and 5xx responses
  • Retries transport-level failures (including timeouts)
  • Uses Retry-After when present, otherwise exponential backoff with jitter
If retries are exhausted, the SDK raises ApiError.

Configure timeout and retries

Async error handling

The async client raises the same exception types: