> ## Documentation Index
> Fetch the complete documentation index at: https://docs.plazza.ca/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> One error shape for every endpoint, in French or English.

Every error has the [AIP-193](https://google.aip.dev/193) shape: an HTTP status, and an `error`
object that says what went wrong for a program and for a person.

```json theme={null}
{
	"error": {
		"code": 400,
		"message": "The request has invalid values: email.",
		"status": "INVALID_ARGUMENT",
		"details": [
			{
				"@type": "type.googleapis.com/google.rpc.ErrorInfo",
				"reason": "INVALID_ARGUMENT",
				"domain": "api.plazza.ca"
			},
			{
				"@type": "type.googleapis.com/google.rpc.LocalizedMessage",
				"locale": "fr",
				"message": "La demande contient des valeurs non valides. Vérifiez-les, puis réessayez."
			},
			{
				"@type": "type.googleapis.com/google.rpc.BadRequest",
				"fieldViolations": [{ "field": "email", "description": "Invalid email address" }]
			}
		]
	}
}
```

| Field | What it's for |
| - | - |
| `code` | The HTTP status. |
| `status` | The [canonical error code](https://google.aip.dev/193#statuscode), such as `NOT_FOUND`. |
| `message` | An explanation for developers, in English. It may change: don't match on it. |
| `details` | What a program and a person need, below. |

## 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](https://docs.plazza.ca/guides/rate-limits.md).

## Statuses

| HTTP | Status | Retry? |
| - | - | - |
| 400 | `INVALID_ARGUMENT`, `FAILED_PRECONDITION`, `OUT_OF_RANGE` | No: fix the request. |
| 401 | `UNAUTHENTICATED` | After [signing in](https://docs.plazza.ca/guides/authentication.md) again. |
| 403 | `PERMISSION_DENIED` | No. |
| 404 | `NOT_FOUND` | No. |
| 409 | `ABORTED`, `ALREADY_EXISTS` | `ABORTED`: read again, then retry. |
| 429 | `RESOURCE_EXHAUSTED` | After its `retryDelay`, when it has one. |
| 500 | `INTERNAL` | Yes, with backoff. |
| 501 | `UNIMPLEMENTED` | No. |
| 503 | `UNAVAILABLE` | Yes, with backoff. |
| 504 | `DEADLINE_EXCEEDED` | Yes, with backoff. |

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"`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.