From 730474da3177ff795f09aeaefcc43bc159a73103 Mon Sep 17 00:00:00 2001 From: Ian Woodard <17186604+IanWoodard@users.noreply.github.com> Date: Mon, 10 Nov 2025 10:33:42 -0800 Subject: [PATCH] ref(conduit): Add error handling around token generation --- src/sentry/conduit/tasks.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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} )