Skip to main content
Every error has a stable code, a suggestion and a retryable flag (see Errors). A good client:
  1. Branches on code, never on the wording of title or detail.
  2. Retries only when retryable is true, waiting for Retry-After when the response has it and backing off when it doesn’t.
  3. Stops on everything else and shows suggestion, because the same request will fail the same way.
  4. Logs request_id from the body or the Request-Id header.
This helper does that. The call below sends a misspelled parameter on purpose, so you can see the answer:
The ones you are most likely to meet: Errors never cost API credits, so a retry that fails again costs nothing.