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.7.tar.gz (4.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: pyexception-notifier-0.0.7.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.7.tar.gz
Algorithm Hash digest
SHA256 dcd6a4a8a7644a1872104d06c778ecc977624b106568a1d66c2fcbc5a1ea2cff
MD5 11666312e37db38793739224d97ba9cd
BLAKE2b-256 bb9c59e3b74a6b50f9a42dade86c74f87c3d9e8e1437f90a969e6c286e358c92

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