Skip to main content

Exception notifier

Project description

package for notify error messages to telegram

How to use?

set env vars

example:
EXCEPTION_NOTIFY_NOTIFY_TO=telegram
EXCEPTION_NOTIFY_BOT_TOKEN=your-bot-token
EXCEPTION_NOTIFY_CHAT_ID=your-chat-id
EXCEPTION_NOTIFY_SERVICE_NAME=your-service-name

initialize exception_notifier with your FastApi app instance

example:

from fastapi import FastAPI

import pyexception_notifier

app = FastAPI()

pyexception_notifier.init(app=app)


@app.get('/error')
async def root():
    zero_division_error = 1 / 0


@app.get('/success')
async def hello():
    return {'ok': 'true'}

then run with gunicorn

gunicorn app:app --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyexception-notifier-0.0.2.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file pyexception-notifier-0.0.2.tar.gz.

File metadata

  • Download URL: pyexception-notifier-0.0.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.27.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.14 CPython/3.10.6

File hashes

Hashes for pyexception-notifier-0.0.2.tar.gz
Algorithm Hash digest
SHA256 07fd64326c2321cd52a0f9e374ee68e4fe8d413d722f2329a6d68f01aba7a6ac
MD5 f4bb64ca45a0ea797e28ae1a8e6c7ff1
BLAKE2b-256 db64879c9c211b2af7ba1febac6ea17a8b7fb9fcfc51abb118a499152506e63b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page