Skip to content

Instantly share code, notes, and snippets.

@povilasb
Created May 15, 2017 13:14
Show Gist options
  • Save povilasb/bafdc311419ffb1d5e224a0643d588f2 to your computer and use it in GitHub Desktop.
Save povilasb/bafdc311419ffb1d5e224a0643d588f2 to your computer and use it in GitHub Desktop.
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