Error Codes

TrueConfAbout 4 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:

{
  "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.

CodeTitleDescription
2INVALID_REQUEST_IDThe request id has already been used.
399WRONG_PAYLOAD_FORMATInvalid 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).

CodeTitleDescription
100CONNECTION_ERRORConnection error
101CONNECTION_TIMEOUTConnection timeout expired
102TLS_ERRORTLS/SSL Error
103UNSUPPORTED_PROTOCOLUnsupported Protocol
104ROUTE_NOT_FOUNDRoute 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.

CodeTitleDescription
200NOT_AUTHORIZEDUnauthorized
201INVALID_CREDENTIALSInvalid credentials
202USER_DISABLEDUser disconnected
203CREDENTIALS_EXPIREDCredentials are outdated
204UNSUPPORTED_CREDENTIALSInvalid 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.

CodeTitleDescription
300INTERNAL_ERRORInternal Server Error
301TIMEOUTOperation timeout
302ACCESS_DENIEDAccess Denied
303NOT_ENOUGH_RIGHTSInsufficient permissions
304CHAT_NOT_FOUNDChat not found
305USER_IS_NOT_CHAT_PARTICIPANTThe user is not a participant in the chat.
306MESSAGE_NOT_FOUNDMessage not found
307UNKNOWN_MESSAGEUnknown message
308FILE_NOT_FOUNDFile not found
309USER_IS_ALREADY_CHAT_PARTICIPANTThe user is already in the chat.
310FILE_UPLOAD_FAILEDFile upload error to the server
311FILE_NOT_READYThe file is not ready yet.
312ROLE_NOT_FOUNDRole 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.

CodeTitleDescription
400UNKNOWNUnknown file error
401NOT_ENOUGH_SPACENot enough space on the server
402BAD_FILE_NAMEInvalid file name
403FILE_UPLOAD_FORBIDDENFile upload is prohibited
404FILE_NOT_FOUNDFile not found
405FILE_NOT_READYThe file is not ready yet.
406ПРЕВЫШЕН МАКСИМАЛЬНЫЙ РАЗМЕР ФАЙЛАMaximum file size exceeded
407UPLOAD_TASK_NOT_FOUNDUpload task not found
408INVALID_FILEInvalid file