Error Codes
Error Codes
For most WebSocket requests, in case of an error, a response in the following format will be sent:
{
"type": 2,
"id": 1,
"payload": {
"errorCode": 200
}
}Please note that the HTTP server returns an error code from the list below in the body, in addition to status 400 Bad Request.
Example:
{
"error": 310,
"error_description": "No task found for request_id: 052b0c6a-da5d-4f72-a408-6d1cb7dcad72"
}Protocol errors
Type of errors related to the format and validity of WebSocket messages: violation of conversion rules (uniqueness and monotonicity of id) or mismatch of payload with the expected format.
| Code | Title | Description |
|---|---|---|
| 2 | INVALID_REQUEST_ID | The request id has already been used. |
| 399 | WRONG_PAYLOAD_FORMAT | Invalid payload format |
Network Errors
Type of errors occurring at the network level, for example, a network connection was not established due to a TLS certificate (102) or a timeout occurred (100).
| Code | Title | Description |
|---|---|---|
| 100 | CONNECTION_ERROR | Connection error |
| 101 | CONNECTION_TIMEOUT | Connection timeout expired |
| 102 | TLS_ERROR | TLS/SSL Error |
| 103 | UNSUPPORTED_PROTOCOL | Unsupported Protocol |
| 104 | ROUTE_NOT_FOUND | Route not found |
Authorization Errors
This type of error is often related to the auth request. If your token has expired, you will receive an error with code 203. In this case, you need to obtain a new token, re-establish the connection, and authenticate again.
| Code | Title | Description |
|---|---|---|
| 200 | NOT_AUTHORIZED | Unauthorized |
| 201 | INVALID_CREDENTIALS | Invalid credentials |
| 202 | USER_DISABLED | User disconnected |
| 203 | CREDENTIALS_EXPIRED | Credentials are outdated |
| 204 | UNSUPPORTED_CREDENTIALS | Invalid token type |
Chat errors
Such errors occur when interacting with chats. For example, when deleting a chat, you may receive a 304 code if an incorrect chatId is specified or the chat was not found on the server.
| Code | Title | Description |
|---|---|---|
| 300 | INTERNAL_ERROR | Internal Server Error |
| 301 | TIMEOUT | Operation timeout |
| 302 | ACCESS_DENIED | Access Denied |
| 303 | NOT_ENOUGH_RIGHTS | Insufficient permissions |
| 304 | CHAT_NOT_FOUND | Chat not found |
| 305 | USER_IS_NOT_CHAT_PARTICIPANT | The user is not a participant in the chat. |
| 306 | MESSAGE_NOT_FOUND | Message not found |
| 307 | UNKNOWN_MESSAGE | Unknown message |
| 308 | FILE_NOT_FOUND | File not found |
| 309 | USER_IS_ALREADY_CHAT_PARTICIPANT | The user is already in the chat. |
| 310 | FILE_UPLOAD_FAILED | File upload error to the server |
| 311 | FILE_NOT_READY | The file is not ready yet. |
| 312 | ROLE_NOT_FOUND | Role not found |
File errors 5.5.6+
These errors occur during file transfers to the server. Previously, any unsuccessful upload returned a general error 310 (FILE_UPLOAD_FAILED). Now, the server returns a more specific code that allows for a more precise determination of the failure cause, such as 406 if the file size exceeds the allowed limit, or 402 if an incorrect file name is specified.
| Code | Title | Description |
|---|---|---|
| 400 | UNKNOWN | Unknown file error |
| 401 | NOT_ENOUGH_SPACE | Not enough space on the server |
| 402 | BAD_FILE_NAME | Invalid file name |
| 403 | FILE_UPLOAD_FORBIDDEN | File upload is prohibited |
| 404 | FILE_NOT_FOUND | File not found |
| 405 | FILE_NOT_READY | The file is not ready yet. |
| 406 | ПРЕВЫШЕН МАКСИМАЛЬНЫЙ РАЗМЕР ФАЙЛА | Maximum file size exceeded |
| 407 | UPLOAD_TASK_NOT_FOUND | Upload task not found |
| 408 | INVALID_FILE | Invalid file |