"""Sentry util functions.""" import os import sentry_sdk if os.environ.get('SENTRY_DSN'): sentry_sdk.init( os.environ.get('SENTRY_DSN'), traces_sample_rate=1.0 ) def capture_exception(): """Capture an exception with Sentry SDK.""" if os.environ.get('SENTRY_DSN'): sentry_sdk.capture_exception()