Error Codes
The Chat API provides stable error codes, which can come from either the server or browser side. These error codes are used in EventError events.
This table lists the possible error codes and their descriptions
Error code | Error Description |
---|---|
Chat command syntactical error codes (range 1 - 49) | |
1 | Unknown chat command |
2 | One or more mandatory parameters are missed in chat command |
3 | Value of chat command parameter is incorrect |
Chat session run-time error codes (range 50-99) | |
50 | Chat session ID is unknown |
51 | Chat command is stopped by decorator |
52 | Error during chat command execution |
Chat server-related error codes (100-149) | |
100 | Chat Server is not available |
101 | Login to Chat Server was failed |
Chat transport error codes (150-199) (generated on browser side) | |
Chat widget error codes (200-249) (generated on browser side) |
Chat Transport Error Messages
This event will be sent in reaction to an unexpected error occurring during the flow of the chat session.
Additionally, this event is sent when the chat component needs to notify clients about unusual cases. For example:
- Chat Server stops responding and the component tries to restore the session on another server.
- A chat session is restored on another instance of Chat Server.
- A channel to the Chat Server is opened, but the server is not yet ready to send/receive operations.
The server generates most of these errors, which the JS transport then passes to the calling code as is. However, there are cases when the JavaScript is responsible for generating an error event — for example, when the connection with server is completely lost.
Here is a list of this kind of JS-generated error:
Error code | Error Description | Comments |
---|---|---|
Chat transport errors (range 150-199) | ||
150 | Network connection interrupted |
Important This error is deprecated and might be removed in future versions. Use session.onInterrupted/onContinued events instead.The transport should report this error when the connection is lost for a period of time. For the default CometD transport, this is a configurable interval with a default value of 3 seconds. Other transports might want to keep to this default. |
151 | Invalid server response. | This error is not reported by the transport itself, but by upper-level code that validates server responses. You do not need need to reimplement this if you are developing custom transport. |
152 | Session restoration failed. | This error happens when a chat session is restored from client state (cookie or another), but the session has already expired on the server. |