# Error Handling

During development of client code (code that makes requests to the Testpad API), it is recommended to catch all errors and to print their details out to the console or a log file for inspection of what went wrong.

Once in production, client code might scale back on the verbosity of its error reporting, however, it should nevertheless always maintain specific handling for the following error conditions, which, in theory, could happen to any request:

<br>

`401 Unauthorized`

Returned when no token is supplied, the Authorization header is malformed, or the token is invalid, expired, deleted or disabled.

<br>

`403 Forbidden`

Returned when the token is valid but access is not permitted: API access is switched off for the account, the account is not enabled for the API, or the token does not have permission for the project being accessed. The body is `{"error": "..."}`.

<br>

`429 Too Many Requests`

The error 429 Too Many Requests will be returned to any request that exceeds Testpad's rate limits. Please see [Rate Limiting](/openapi/rate-limiting) for details.

If your code receives this error, it must wait for the indicated amount of time before trying again.


