Last active
October 13, 2016 21:58
-
-
Save lgyanf/15dee32ec15f804a67db26a73c661a5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sentry import report_error | |
@report_error | |
def main(): | |
raise ValueError('test') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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