raven-python
raven-python copied to clipboard
Sanic integration
I assume there are no plans whatsoever to integrate with Sanic, so I'll be handling it manually, but I'll be more than interested in writing an integration myself.
For additional context, Sanic is an asyncio based framework that's made to go fast™, with an API cloning that of Flask.
I'll begin work on this starting next week, but in the meantime, does any useful advice spring to mind?
@jrocketfingers should be mostly easy as you only need to hook into a common point for catching errors. Outside of that, the Flask integration is probably the best to imitate.
I haven't been able to get to work on this.
For the random internet citizen: in the meantime, you can log to Sentry with something along the lines of:
# whever-you-initialized-your-app.py
@app.exception(Exception)
def log_to_sentry(request, exception):
request.app.raven.captureException({'extra': {'request': request}})
Starting this over here: https://github.com/newsela/raven-python/tree/sanic-client
I don't think it'll be particularly tricky, probably will have it wrapped up this weekend.
@jrocketfingers that PR's ready to go, minus one test I can't reproduce failures on locally.