Skip to content

Instantly share code, notes, and snippets.

@lgyanf
Last active October 13, 2016 21:58
Show Gist options
  • Save lgyanf/15dee32ec15f804a67db26a73c661a5a to your computer and use it in GitHub Desktop.
Save lgyanf/15dee32ec15f804a67db26a73c661a5a to your computer and use it in GitHub Desktop.
from sentry import report_error
@report_error
def main():
raise ValueError('test')
import raven
client = Client('https://<key>:<secret>@sentry.io/<project>')
def report_error(fn):
def wrapper(*args, **kwargs):
try:
fn(*args, **kwargs)
except Exception:
client.captureException()
raise
return wrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment