Error
The Error type is based on the the examples set out by the DI API Guidelines.
We have deviated from the examples by creating a well-defined type rather than multiple top-level fields as we believe this is more intuitive without violating the spirit of the guidelines.
| Field | Type | Required? | Since | Description |
|---|---|---|---|---|
| id | String | yes | 2.0 | A unique ID that can be used to look up the specific error in the logs |
| code | Integer | yes | 2.0 | A a non-negative integer indicating the type of error |
| name | String | yes | 2.0 | A string constant indicating the type of error |
| message | String | yes | 2.0 | A user-friendly error message |
Example
{
"id": "cf13ead5-fc5c-42e4-8c47-478412b204da",
"code": 1,
"name": "INPUT.BAD_REQUEST",
"message": "Your email address is required"
}
Error Codes and Names
Error Code Ranges
Error codes may fall into one of the following ranges
From | To | Description |
|---|---|---|
| 0 | 99 | Predefined error codes. See below for a list of standard codes. |
| 100 | 599 | Unused due to potential confusion with HTTP status codes. |
| 600 | 999 | Predefined error codes. See below for a list of standard codes. |
| 1000 | Custom error codes. See below for a list of Chatbot error codes. |
Predefined Error Codes
The following table describes predefined error codes copied from the DI API Guidelines.
Code | Name | HTTP Status | Description |
|---|---|---|---|
| 1 | INPUT.BAD_REQUEST | 400 | generic message for client based error. |
| 2 | SECURITY.MISSING_AUTHENTICATION | 401 | Authentication for this resource is required and was not provided. |
| 3 | SECURITY.CANNOT_AUTHENTICATE | 401 | Authentication details have been sent but cannot be used. |
| 4 | SECURITY.NOT_AUTHORIZED | 401 | Authentication details have been sent but you are not allowed to access the resource. |
| 5 | SECURITY.ACCESS_FORBIDDEN | 403 | For reasons other than authentication, you are not allowed to access the resource. |
| 6 | GENERAL.RESOURCE_NOT_FOUND | 404 | The resource being access cannot be found or does not exist. |
| 7 | INPUT.METHOD_NOT_ALLOWED | 405 | |
| 999 | SYSTEM.INTERNAL_ERROR | 500 | generic message for internal error |
Custom Error Codes
The following table describes custom error codes for the GX Chatbot
Code | Name | HTTP Status | Description |
|---|---|---|---|
| 1000 | APP.ILLEGAL_CHAT_STATE | 400 | An active chat session is not available. Either the client has not called /v1/hello or has called /v1/goodbye. |
| 1001 | APP.ORIGIN_DENIED | 403 | The request came from an origin that was not permitted. Contact the GS Technology Team to have the origin white-listed. |
| 1002 | APP.INVALID_PRODUCT | 400 | The requested product is not available. The likely cause is that the client was not correctly configured. |
Error Name Prefixes
Prefix | Description | Example |
|---|---|---|
| APP | Custom error messages. | APP.UNSUPPORTED_LANGUAGE |
| GENERAL | Common general-function error messages. | GENERAL.PAGE_NOT_FOUND |
| INPUT | Customer input error messages. Generally used with HTTP status code 400. | INPUT.MISSING_DATA |
| SYSTEM | Common system based error messages. generally used with HTTP status code 500. | SYSTEM.UNRESPONSIVE |
| SECURITY | Common security error messages. generally used w/ HTTP status code 401 or 403. | SECURITY.NOT_AUTHORIZED |