Error codes
The following list shows the possible Fauna error codes returned in an error response. The list isn’t exhaustive.
Errors should be handled, first, based on the Fauna error code. If the response includes an error code not shown in the following list, the error should be handled according to the HTTP status code.
Error responses tend to be self-explanatory and include a detailed description of the error, including the location in the query string where the error is detected, if applicable.
Error code list
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example error responses
The message part of the error response is descriptive and formatted, indicating the location in the expression or statement where the error occurred, if applicable.
Simple response
{
"error": {
"code": "invalid_function_invocation",
"message": "The function `al` doesn't exist on `Collection`"
},
... elided ...
}
Formatted response with error location
{
"error": {
"code": "invalid_query",
"message": "The query failed 1 validation check"
},
"summary": "error: Missing return expression\nat *query*:1:13\n |\n1 | let x = true\n | ^\n |\ncause: Statement doesn't return a value\n |\n1 | let x = true\n | ^^^^^^^^^^^^\n |",
... elided ...
}
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!