The detail errors¶
User error codes These errors generally indicate a problem on the client side. If you are getting one of these, check your code and the request details.
400 Bad Request The request encoding is invalid; the request can't be parsed as a valid JSON.
401 Unauthorized Accessing a protected resource without authorization or with invalid credentials.
403 Forbidd 500 Internal Server Error The server encountered an unexpected condition.
502 Bad Gateway Airtable's servers are restarting or an unexpected outage is in progress. You should generally not receive this error, and requests are safe to retry.
503 Service Unavailable The server could not process your request in time. The server could be temporarily unavailable, or it could have timed out processing your request. You should retry the request with backoffs.
Example error responses 404 The path is not valid.
404 Not Found
404 Not Found
403 You don't have the right permission for the resource, or the resource was not found.
Check that both you and the token have access to the resource. For example, to access a base using a personal access token, your user must be a collaborator and the token must also have access to the base. See this guide for more details.
403 Forbidden
{
"error": {
"type": "INVALID_PERMISSIONS_OR_MODEL_NOT_FOUND",
"message": "Invalid permissions, or the requested model was not found. Check that both your user and your token have the required permissions, and that the model names and/or ids are correct."
}
}
You don't have permission to create records in the given table. This is returned both when creating records directly, and when creating linked records while updating cell values.
Check whether the table or any fields you are setting values for have editing permissions limited.
403 Forbidden
{
"error": {
"type": "INVALID_PERMISSIONS",
"message": "You are not permitted to create records in table TABLE_NAME (TABLE_ID)"
}
}
You don't have permission to update cell values in the given field. Check whether the field has editing permissions limited.
403 Forbidden
{
"error": {
"type": "INVALID_PERMISSIONS",
"message": "You are not permitted to write cell values in field FIELD_NAME (FIELD_ID)"
}
}
You don't have the right permission for the action.
403 Forbidden
{
"error": {
"type": "INVALID_PERMISSIONS",
"message": "You are not permitted to perform this operation"
}
}
422 The path is correct, however the body is either not understood or not permitted.
422 Unprocessable Entity
{
"error": {
"type": "INVALID_REQUEST_UNKNOWN",
"message": "Invalid request: parameter validation failed. Check your request data."
}
}
503 The server is temporarily unavailable and the request should be retried. The Retry-After header may be provided.
503 Service Unavailable
{
"error": {
"type": "RETRIABLE_ERROR",
"message": "Server encountered an error while processing your request, and it is safe to retry the request"
}
}
Here we are:
{
"status": 404,
"body": {
"error": {
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such customer: 'cus_Jop8JpEFz1lsCL'; a similar object exists in live mode, but a test mode key was used to make this request.",
"param": "id",
"type": "invalid_request_error"
}
},
"headers": {
"request-id": "req_su1OkwzKIeEoCy",
"stripe-version": "2020-08-27"
}
}
# TODO: Custom here https://www.getorchestra.io/guides/pydantic-custom-error-handling-in-fastapi-a-detailed-tutorial
# @app.exception_handler(ValidationError)
# async def validation_exception_handler(request: Request, exc: ValidationError):
# errors = [{"field": err['loc'][0], "message": err['msg']} for err in exc.errors()]
# return JSONResponse(
# status_code=422,
# content={"message": "Validation Error", "details": errors},
# )
# from pydantic import BaseModel, ValidationError, create_model
# from pydantic.error_wrappers import ErrorList
# from starlette.exceptions import HTTPException as StarletteHTTPException
# from starlette.exceptions import WebSocketException as WebSocketException # noqa: F401
# TODO: Added LABEL_TO_EXCEPTION in dict[str, Error]
# https://docs.pydantic.dev/latest/errors/errors/#customize-error-messages
# Requirements: Custom template for context in case of the component
# The context will put into the message
# Python Error:
# Database Error: # Ref https://peps.python.org/pep-0249/#exceptions
# Dependencies Errror: Error from depenedencies