Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report errors to Sentry #33

Open
smn opened this issue Sep 15, 2015 · 0 comments
Open

Report errors to Sentry #33

smn opened this issue Sep 15, 2015 · 0 comments

Comments

@smn
Copy link
Contributor

smn commented Sep 15, 2015

This came up in #32.

According to: http://stackoverflow.com/a/24313600 one way to get Twisted errors logged in Sentry is like so:

from twisted.python import log
from raven import Client


client = Client(dsn='twisted+http://YOUR_DSN_HERE')

def logToSentry(event):
    if not event.get('isError') or 'failure' not in event:
        return

    f = event['failure']
    client.captureException((f.type, f.value, f.getTracebackObject()))

log.addObserver(logToSentry)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant