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. |
<th>
`"error"`
</th>
<th>
`"subCode"`
</th>
<th>
definition
</th>
</tr>
<td>
`request_error`
</td>
<td>
1
</td>
<td>
Required parameter not specified: %s
</td>
</tr>
<tr>
<td>
400
</td>
<td>
`request_error`
</td>
<td>
2
</td>
<td>
Invalid format: %s (%s)\
(Please validate on the client side)
</td>
</tr>
<tr>
<td>
400
</td>
<td>
`request_error`
</td>
<td>
3
</td>
<td>
Invalid ID format: %s
</td>
</tr>
<tr>
<td>
400
</td>
<td>
`request_error`
</td>
<td>
4
</td>
<td>
Invalid RequestBody: %s
</td>
</tr>
<tr>
<td>
400
</td>
<td>
`request_error`
</td>
<td>
5
</td>
<td>
Required header params is not found: %s
</td>
</tr>
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 |