The four shapes of an error
Which shape you get depends on who refused the request.1. The error envelope
Sent by the gateway (key, quota and rate-limit problems) and by the data API (an unknown filter field, a duplicate value).2. A plain message
A refusal from a service endpoint, such as sign-in, is a bare JSON string:"Authentication required", "Not found".
3. A list of validation errors (422)
A request body that failed validation lists one entry per field:loc is the path to the offending field and msg is readable. The SDKs turn these into per-field messages (see below).
4. A query problem
A bad query parameter, and framework refusals such as a wrong method, answer{ "detail": … } where detail is a list like the one above, or a string.
The error codes
Flows can also fail a run with their own HTTP status, code and message using the error block (
error.raise).
What each status means
A 404 can mean “not allowed to see it”. Pawabase doesn’t reveal that a record exists to someone who may not read it.
Errors in the SDKs
All errors extend one base type. Catch the specific ones you care about and let the rest bubble up.
In Python,
QuotaExceededError (a kind of ForbiddenError) means the plan’s limit is reached.
What an error carries
ValidationError also has issues, fieldError(field) and byField() for form messages.
Retries
The SDKs already retry rate limits (429), 502, 503, 504 and network failures, with short growing delays, and they honour retry_after. You see an error only if it keeps failing. Tune it with the retry option, or pass retry: false.
Do not retry 400, 401 (after the SDK’s own refresh), 403, 404, 409 or 422: the same request will fail the same way. Fix the request first.
When you retry a write, make it safe to repeat: use a unique key your own code controls, so a repeated request returns 409 instead of creating a second record.
Errors in other places
Contacting support
Include the request id (x-request-id), the time, the environment and what you expected. With the id, support (and you, in Activity) can see exactly what happened, including which rule refused a call.