Error Handling
Overview
We use standard HTTP status codes to indicate remote communication errors.
We use an error model to indicate the success or failure of the logic that the function invokes on HTTP OK.
Error Model
The error model for Flight APIs is logically defined by Status
, an instance of which is returned to the client when an API error occurs.
The following table shows the overall design of the error model:
Name | Type | Description |
---|---|---|
Message |
String |
a friendly text |
Code |
Integer |
error code |
example for Status
of the response will be JSON in the following format:
{
"Status": {
"Message": "resource not found",
"Code": 10000003
}
}
ErrorCode
There are some common error codes for function logic we defined as follows:
Code | Description |
---|---|
0 |
Success |
10000000 |
Client specified an invalid argument. Check error message and error details for more information |
10000001 |
Client does not have sufficient permission |
10000002 |
The resource that a client tried to create already exists. |
10000003 |
A specified resource is not found |
50000000 |
Unknown server error. Typically a server bug |
50000001 |
Internal server error. Typically a server bug |
50000002 |
Internal server handle timeout, it doesn’t mean the client should try again |
50000003 |
Internal server handle error and the client should try again |