Created
May 15, 2017 13:14
-
-
Save povilasb/bafdc311419ffb1d5e224a0643d588f2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 typing import Callable | |
import raven | |
_CLIENT = raven.Client() | |
def track_exceptions(func: Callable) -> Callable: | |
def tracked_call(*args, **kwargs): | |
try: | |
return func(*args, **kwargs) | |
except: | |
_CLIENT.captureException() | |
raise | |
return tracked_call | |
def setup(sentry_dsn: str) -> None: | |
_CLIENT.set_dsn(sentry_dsn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment