In the Quickstart, you saw a first example of an error message.
This is what you could see in your Terminal:
{"error":"request_error","subCode":4,"message":"Invalid request body","detail":[{"code":"invalid_type","expected":"array","received":"undefined","path":["select"],"message":"Required"}]}
Or in JSON format:
{
"error": "request_error",
"subCode": 4,
"message": "Invalid request body",
"detail": [
{
"code": "invalid_type",
"expected": "array",
"received": "undefined",
"path": [
"select"
],
"message": "Required"
}
]
}
The error object in Morph API:
Property | Description | Example |
---|
"error" | The kind of error | "request_error" |
"subCode" | number which categorizes further the error. | 4 |
"message" | Short text that describes the error. | "Invalid request body" |
"detail" | An array of object giving additional information to help with debugging. | See example below. |
HTTP status code | Description |
---|
200 | Your request to Morph API was successful. |
HTTP status code | "error" | "subCode" | definition |
---|
400 | request_error | 1 | Required parameter not specified: %s |
400 | request_error | 2 | Invalid format: %s (%s)
(Please validate on the client side) |
400 | request_error | 3 | Invalid ID format: %s |
400 | request_error | 4 | Invalid RequestBody: %s |
400 | request_error | 5 | Required header params is not found: %s |
HTTP status code | "error" | "subCode" | definition |
---|
401 | auth_error | 1 | Token is expired. |
401 | auth_error | 2 | User associated with the token could not be found. |
401 | auth_error | 3 | User have not signed up yet. |
401 | auth_error | 4 | API Key is invalid. |
HTTP status code | "error" | "subCode" | definition |
---|
200 | database_error | 1 | Database does not exist. |
200 | database_error | 2 | Database has already exist. |
200 | database_error | 3 | The specified databaseSlug is already in use. |
HTTP status code | "error" | "subCode" | definition |
---|
200 | table_error | 1 | Table does not exist. |
200 | table_error | 2 | Table has already exist. |
200 | table_error | 3 | You have no permission |
200 | table_error | 4 | This table is read only table. cannot edit |
200 | table_error | 5 | This table is not deletable. some referenced tables exist. |
200 | table_error | 6 | Join is not allowed with the column |
HTTP status code | "error" | "subCode" | definition |
---|
200 | field_error | 1 | Field does not exist. |
200 | field_error | 2 | Field has already exist. |
200 | field_error | 3 | Relation is not allowed with the column |
200 | field_error | 4 | Delete is not allowed with the column |