Skip to main content
Every error has the AIP-193 shape: an HTTP status, and an error object that says what went wrong for a program and for a person.

Details

  • ErrorInfo is always there. Its reason names the cause in upper snake case, such as NOT_A_SESSION, and is stable: branch on status and reason. metadata, when present, holds the values the cause depends on.
  • LocalizedMessage is always there too: a message to show to a person, in the language the request asked for with Accept-Language, French (fr) or English (en). English is the default.
  • BadRequest comes with a 400 for a body or query that fails its schema. Each fieldViolation names a field by its path, such as address.street or items[0].name, and describes the problem in English.
  • RetryInfo comes with a 429: its retryDelay, such as "42s", says how long to wait before retrying. See Rate limits.

Statuses

A server error’s message never carries stack traces, queries or other internals. An UNAVAILABLE error names what is down in its ErrorInfo metadata, such as "dependency": "database".