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

Uploaded Source

File details

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

File metadata

  • Download URL: pyexception-notifier-0.0.3.tar.gz
  • Upload date:
  • Size: 4.9 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.3.tar.gz
Algorithm Hash digest
SHA256 06e5ca38a1dcff59858cda03fb24851cf9839be45ec76287ab8c6ff1dc5eb021
MD5 4afc4018cbd8d094efa4d8d4c0e8f976
BLAKE2b-256 a679c53e0ab51ab4c9d20bb4d5736596b61203b96965a67f415a26e8f977bf99

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