Module telereddit.exceptions
Catched exceptions of the software.
The application follows the try/catch pattern to return errors in the program flow between two functions.
Classes
class TeleredditError (msg: Any, data: Any = None, capture: bool = False)
-
Base class for all catched exceptions.
Parameters
msg
:str
-
Exception message to be bubbled up.
Note
In most cases this error message will be sent as a Telegram message to warn the user that something went wrong.
data
:dict (Default value = None)
- Extra data to be sent to Sentry if
capture
is set to True. capture
:Boolean (Default value = False)
- Whether to send the exception to Sentry issue tracking service, if Sentry is configured.
Notes
All children exceptions have the same parameters.
Ancestors
- builtins.Exception
- builtins.BaseException
Subclasses
class PostError (msg: Any, data: Any = None, capture: bool = True)
-
Base class for post related exceptions.
Capture
Unless specified otherwise, these are true errors of the application and should be captured by Sentry.
Ancestors
- TeleredditError
- builtins.Exception
- builtins.BaseException
Subclasses
class MediaError (msg: Any, data: Any = None, capture: bool = True)
-
Base class for media related exceptions.
Capture
These errors cause the retrieved post not to be sent, or to be sent not as it should be. Therefore they represent a critical part of the application. For this, unless specified otherwise, they should be captured by Sentry.
Ancestors
- TeleredditError
- builtins.Exception
- builtins.BaseException
Subclasses
class PostSendError (data: Any = None, capture: bool = True)
-
Raised when there's an error in sending the post to the Telegram chat.
E.g. the format of the message that is being sent is not the one Telegram APIs expect.
Ancestors
- PostError
- TeleredditError
- builtins.Exception
- builtins.BaseException
class PostEqualsMessageError (data: Any = None, capture: bool = False)
-
Raised when the post in the Telegram message is the same as the retrieved.
Capture
This error is useful when editing a Telegram message with a different post. It is thus raised as a correct program flow, and therefore it should not be captured from Sentry.
Ancestors
- PostError
- TeleredditError
- builtins.Exception
- builtins.BaseException
class MediaTooBigError (data: Any = None, capture: bool = True)
-
Raised when post media exceeds the max media size allowed by Telegram APIs.
Seealso
Telegram Bot API on sending files: https://core.telegram.org/bots/api#sending-files
Ancestors
- MediaError
- TeleredditError
- builtins.Exception
- builtins.BaseException