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

Uploaded Source

File details

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

File metadata

  • Download URL: pyexception-notifier-0.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 25627b3add87338d227360c38be225ce052a36a24b58ff6f2104d1e6cb499172
MD5 b27ed94a154cf5bdbfc41e103342f1dd
BLAKE2b-256 040bbecca530fc74c4539612c64242b9dda3f6910bf71b889f384780bed6dded

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