error.code for the type of failure and error.reason for its specific cause. Use error.param to find an invalid input, and keep meta.request_id when asking for support.
Retry only when another request can succeed. Invalid inputs need a correction, inactive subscriptions need reactivation, and expired cursors need a new first page.
Read an error response
New reasons can be added. If you do not recognize a reason, handle its code rather than assuming success.
Choose an action by code
Correct an input or credential
Restart or change the requested work
For
freshness_ceiling_unsatisfied, error.freshness includes max_age_s and data_quality_status. It also includes actual_age_s and as_of when the server has a clock to measure; no immediate retry time is promised.
Wait or schedule a later request
A
503 without a reason means the rate limiter is unavailable. Back off authenticated calls for the specified delay.
Retry timing
These responses include bothRetry-After in seconds and a future error.retry_at:
- Every
429and503. 404with reasonpick_not_released.408on aGETorHEAD.
Retry-After for a delay because it avoids client clock differences. Use retry_at when scheduling a job for an absolute time; long quota and pick-release delays belong in a scheduler.
Example: bounded retries for a read
This Python example makes at most 3 attempts. It schedules neither pick release nor monthly reset, and leaves delays over 60 seconds to the caller:Check batch items too
A batch can return HTTP200 while individual items fail. Inspect every data[i].status; an item with status: error has its own error.code and error.message.