Error Codes

TrueConfAbout 2 min

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:

```json
{
  "error": 310,
  "error_description": "No task found for request_id: 052b0c6a-da5d-4f72-a408-6d1cb7dcad72"
}

## Network errors {#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 {#auth-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 {#chats-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                          |