diff --git a/src/sentry/conduit/tasks.py b/src/sentry/conduit/tasks.py index a659b78467e66f..c8f11263a2c6f1 100644 --- a/src/sentry/conduit/tasks.py +++ b/src/sentry/conduit/tasks.py @@ -5,6 +5,7 @@ from uuid import uuid4 import requests +import sentry_sdk from django.conf import settings from google.protobuf.struct_pb2 import Struct from google.protobuf.timestamp_pb2 import Timestamp @@ -36,7 +37,11 @@ ) def stream_demo_data(org_id: int, channel_id: str) -> None: """Asynchronously stream data to Conduit.""" - token = generate_jwt(subject="demo") + try: + token = generate_jwt(subject="demo") + except ValueError as e: + sentry_sdk.capture_exception(e, level="warning") + return logger.info( "conduit.stream_demo_data.started", extra={"org_id": org_id, "channel_id": channel_id} )