Skip to main content

Travis PyPI

Sentry error handler for Sanic web server

Requirements

  • python >= 3.5

Installation

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

pip install sanic-sentry-error-handler

Usage

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('http://public:secret@example.com/1')

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('http://public:secret@example.com/1')
>>> 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)

Release files for sanic-sentry-error-handler 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sanic-sentry-error-handler 0.1.7
File Size Uploaded
sanic-sentry-error-handler-0.1.7.tar.gz 2.9 kB Details

Release files / sanic-sentry-error-handler-0.1.7.tar.gz

Download URL sanic-sentry-error-handler-0.1.7.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b4a40a83ee86ff5ee4d83e52cc9a7f24f1bc1cb934a1c438545d3df64cd08acc
BLAKE2b-256 checksum
How to use checksums
a6224125cdae4716c518247fccc67d2ac81efb6d1afea4fdf0b879c63e5cd1d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Release history Release notifications | RSS feed

This release

0.1.7 This release

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page