\Hawkings\Exception\ApiError,
with subclasses for each error type (AuthenticationError,
PermissionError, NotFoundError, InvalidRequestError,
RateLimitError, IdempotencyError, NetworkError). Catch ApiError
to handle anything.
Error taxonomy
| Class | HTTP | When it fires | Retryable? |
|---|---|---|---|
AuthenticationError | 401 | Bad/expired API key, missing scope. | No |
PermissionError | 403 | Key valid, but no access to this resource. | No |
NotFoundError | 404 | Resource doesn’t exist or is in another workspace. | No |
InvalidRequestError | 422 | Validation failed. Inspect err.fields. | No |
RateLimitError | 429 | Too many requests. err.retry_after is the seconds to wait. | Yes (auto) |
IdempotencyError | 409 | Same idempotency_key reused with a different payload. | No |
APIError | 5xx | Hawkings is having a moment. Auto-retried with backoff. | Yes (auto) |
NetworkError | n/a | DNS, TLS, timeout. Auto-retried with backoff. | Yes (auto) |
Automatic retries
The SDK retries 429 and 5xx responses automatically with exponential backoff and jitter. Defaults:Idempotency keys
Anycreate*, update*, or AI generation call can carry an
Idempotency-Key. Same key + same body = same response, even if you
call it 100 times. Different body with the same key throws
IdempotencyError.
Error envelope
Every error response carries a structured body:request_id — it’s all we need to
trace a request end-to-end.