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.

FieldTypeRequired?SinceDescription
idStringyes2.0A unique ID that can be used to look up the specific error in the logs
codeIntegeryes2.0A a non-negative integer indicating the type of error
nameStringyes2.0A string constant indicating the type of error
messageStringyes2.0A 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

099Predefined error codes. See below for a list of standard codes.
100599Unused due to potential confusion with HTTP status codes.
600999Predefined 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

1INPUT.BAD_REQUEST400generic message for client based error.
2SECURITY.MISSING_AUTHENTICATION401Authentication for this resource is required and was not provided.
3SECURITY.CANNOT_AUTHENTICATE401Authentication details have been sent but cannot be used.
4SECURITY.NOT_AUTHORIZED401Authentication details have been sent but you are not allowed to access the resource.
5SECURITY.ACCESS_FORBIDDEN403For reasons other than authentication, you are not allowed to access the resource.
6GENERAL.RESOURCE_NOT_FOUND404The resource being access cannot be found or does not exist.
7INPUT.METHOD_NOT_ALLOWED405
999SYSTEM.INTERNAL_ERROR500generic message for internal error

Custom Error Codes

The following table describes custom error codes for the GX Chatbot

Code

Name

HTTP Status

Description

1000APP.ILLEGAL_CHAT_STATE400An active chat session is not available. Either the client has not called /v1/hello or has called /v1/goodbye.
1001APP.ORIGIN_DENIED403The request came from an origin that was not permitted. Contact the GS Technology Team to have the origin white-listed.
1002APP.INVALID_PRODUCT400The requested product is not available. The likely cause is that the client was not correctly configured.

Error Name Prefixes

Prefix

Description

Example

APPCustom error messages.APP.UNSUPPORTED_LANGUAGE
GENERALCommon general-function error messages.GENERAL.PAGE_NOT_FOUND
INPUTCustomer input error messages. Generally used with HTTP status code 400.INPUT.MISSING_DATA
SYSTEMCommon 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