Exceptions
trueconf.exceptions ⚓︎
ApiErrorException ⚓︎
Raised when TrueConf Server returns an API error response.
This exception stores the server error code, human-readable detail, and optional response payload for additional context.
Attributes:
| Name | Type | Description |
|---|---|---|
code | Error code returned by the server. | |
detail | Human-readable error description. | |
payload | Raw error payload returned by the server, or an empty dict. |
ChannelTitleTooLongError ⚓︎
Raised when a channel title exceeds the maximum allowed length.
Attributes:
| Name | Type | Description |
|---|---|---|
actual_value | Actual length of the channel title. | |
limit | Maximum allowed channel title length. |
ChatTitleTooLongError ⚓︎
FileCaptionTooLongError ⚓︎
Raised when a file caption exceeds the maximum allowed length.
The default caption limit is 4096 visible characters. For long captions, use safe_split_text from trueconf.utils and send the returned chunks separately when appropriate.
Attributes:
| Name | Type | Description |
|---|---|---|
actual_value | Actual visible length of the caption. | |
limit | Maximum allowed caption length. |
FileSizeTooLargeError ⚓︎
Raised when a file exceeds the maximum size allowed by the server.
File size limits are configured by the TrueConf Server administrator and are checked by the bot before sending a file.
Attributes:
| Name | Type | Description |
|---|---|---|
actual_value | Actual file size in bytes. | |
limit | Maximum allowed file size in bytes. |
FileValidationError ⚓︎
Base exception for file validation errors.
This class is used for errors related to file size limits, extension filters, and other file validation rules received from TrueConf Server.
GroupTitleTooLongError ⚓︎
Raised when a group title exceeds the maximum allowed length.
Attributes:
| Name | Type | Description |
|---|---|---|
actual_value | Actual length of the group title. | |
limit | Maximum allowed group title length. |
InvalidFileExtensionError ⚓︎
Raised when a file extension does not satisfy the server extension filter.
File extension rules are configured by the TrueConf Server administrator. Depending on the filter mode, the extension list can work either as an allow list or as a block list.
Attributes:
| Name | Type | Description |
|---|---|---|
extension | File extension that failed validation. | |
extensions | Set of extensions used for validation. | |
mode | Extension filter mode. |
InvalidGrantError ⚓︎
Raised when the server rejects the provided authorization grant.
This usually means that the token or credentials are invalid, expired, revoked, or cannot be used to authorize the bot.
LimitExceededError ⚓︎
Base exception for all limit-related errors.
This class is used for errors related to text length, title length, file size, and other numeric limits.
Attributes:
| Name | Type | Description |
|---|---|---|
actual_value | Actual value that exceeded the limit. | |
limit | Maximum allowed value. |
TextMessageTooLongError ⚓︎
Raised when a text message exceeds the maximum allowed length.
The default text message limit is 4096 visible characters. For long texts, such as LLM-generated responses, use safe_split_text from trueconf.utils and send the returned chunks one by one.
Attributes:
| Name | Type | Description |
|---|---|---|
actual_value | Actual visible length of the message text. | |
limit | Maximum allowed message length. |
TokenValidationError ⚓︎
Raised when the bot token fails local validation.
This error indicates that the token value has an invalid format or cannot be used by the connector before the authorization request is sent.
TrueConfChatBotError ⚓︎
Base exception for all TrueConf ChatBot Connector errors.
All custom exceptions raised by the library inherit from this class. You can catch this exception to handle any library-specific error in a single place.