Skip to main content

Python and Rust SDKs 0.2.0: what to retry, and when

hatang 0.2.0 for Python and Rust tells a call worth retrying from one that will keep failing, the way the API docs describe it.

SDKReleaseRegistry
Pythonhatang 0.2.0PyPI
Rusthatang 0.2.0crates.io
  • Retryable: Ha Tang unreachable, 429 rate_limit_exceeded, 409 concurrent_idempotent_requests (the same idempotency key is still running) and 5xx. Retry with the same idempotency key.
  • Wait as asked: the retry-after header is on the error (retry_after in Python, retry_after() in Rust).
  • Daily quota: 429 daily_quota_exceeded is no longer retryable, since it resets at midnight UTC. Check it with quota_exceeded (Python) or is_quota_exceeded() (Rust).
  • Rust only, breaking: Error::Api has a new field and is #[non_exhaustive]. Match it with Error::Api { status, name, .. }.

See Python: results and errors and Rust: results and errors.