Skip to main content

Errors and Retries

All SDK errors inherit from DalyAPIError.

Exception Mapping

Retry Semantics

  • The SDK does not do general automatic retries.
  • It retries once only for 401 after token invalidation/refresh.
  • Caller-managed retries are recommended for 429, transient 5xx, and timeouts.

Rate-Limit Support

RateLimitError includes retry_after when API returns Retry-After header.

Timeout Semantics

SDK wraps httpx timeout exceptions into TimeoutError with:
  • status_code = 0
  • consistent DalyAPIError inheritance for unified exception handling

Suggested Catch Pattern