Skip to main content

Sanic error handlert that integrates with Sentry

Project description

Travis PyPI

Sentry error handler for Sanic web server


  • python >= 3.5


sanic-sentry-error-handler should be installed using pip:

pip install sanic-sentry-error-handlert


SENTRY_DSN - Sentry DSN for your application

To begin we’ll set up a Sanic app:

>>> from sanic import Sanic
>>> from sanic_sentry import SanicSentryErrorHandler
>>> app = Sanic(__name__)
>>> app.error_handler = SanicSentryErrorHandler('')

If your application uses the Sanic exception handling views you might consider using decorator for intercepting the exceptions.

>>> from sanic import response, Sanic
>>> from sanic_sentry import SanicSentryErrorHandler
>>> sentry_client = SanicSentryErrorHandler('')
>>> app = Sanic(__name__)
>>> @app.exception([Exception, ])
>>> @sentry_client.intercept_exception
>>> def handle_exception_500(request, exception):
>>>     return response.json({"description": "Internal Server Error"}, status=500)

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
sanic-sentry-error-handler-0.1.3.tar.gz (2.8 kB) Copy SHA256 hash SHA256 Source None Mar 14, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page