error-alerts
Python error alerts via Telegram
Installation:
pip install error-alerts
Options:
telegram_token: Bot Telegram token.
telegram_channel: Your Telegram channel ID where you want the alerts to be sent.
full_error: Send full traceback with line of code where error occurred (False by default and shown in sample below).
raise_error: Raise error and exit code when there is an error. If this is not set to True an alert will be sent and the code will continue running (False by default).
Usage:
import alerts
alerts = alerts.setup(
telegram_token='TELEGRAM_TOKEN',
telegram_channel=TELEGRAM_CHANNEL_ID,
full_error=True,
raise_error=True
)
try:
1 / 0
except Exception as error:
alerts.send(title='Test', exception=error)
Output:
Test: Traceback (most recent call last):
File "A:\Code\Python\packages\handler\test.py", line 6, in <module>
1 / 0
ZeroDivisionError: division by zero
Prints that in console and sends a Telegram alert to the channel you specified
Release files for error-alerts 2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| error-alerts-2.tar.gz | 1.8 kB | Details |
Release files / error-alerts-2.tar.gz
| Download URL | error-alerts-2.tar.gz |
|---|---|
| Size | 1.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f4c91fef4e67703b5f3f53c0399da48b151be675de944069842b27882ac62d7
|
|
BLAKE2b-256 checksum How to use checksums |
8a7a9b2db44e35b91855bcb1056af5348696d8151e08a40ad2339b9dadaa16ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.9
|