Skip to content

Commit 3174afe

Browse files
do not manually set error
1 parent 70a0e3f commit 3174afe

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

sentry_sdk/integrations/arq.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
66
from sentry_sdk.integrations.logging import ignore_logger
77
from sentry_sdk.scope import should_send_default_pii
8-
from sentry_sdk.traces import SegmentSource, SpanStatus
8+
from sentry_sdk.traces import SegmentSource
99
from sentry_sdk.tracing import Transaction, TransactionSource
1010
from sentry_sdk.tracing_utils import has_span_streaming_enabled
1111
from sentry_sdk.utils import (
1212
SENSITIVE_DATA_SUBSTITUTE,
13+
_register_control_flow_exception,
1314
capture_internal_exceptions,
1415
ensure_integration_enabled,
1516
event_from_exception,
@@ -61,6 +62,8 @@ def setup_once() -> None:
6162
patch_run_job()
6263
patch_create_worker()
6364

65+
_register_control_flow_exception(ARQ_CONTROL_FLOW_EXCEPTIONS)
66+
6467
ignore_logger("arq.worker")
6568

6669

@@ -136,13 +139,7 @@ async def _sentry_run_job(self: "Worker", job_id: str, score: int) -> None:
136139
def _capture_exception(exc_info: "ExcInfo") -> None:
137140
scope = sentry_sdk.get_current_scope()
138141

139-
span_streaming = has_span_streaming_enabled(sentry_sdk.get_client().options)
140-
if span_streaming and scope.streamed_span is not None:
141-
if exc_info[0] in ARQ_CONTROL_FLOW_EXCEPTIONS:
142-
return
143-
144-
scope.streamed_span.status = SpanStatus.ERROR
145-
elif not span_streaming and scope.transaction is not None:
142+
if scope.transaction is not None:
146143
if exc_info[0] in ARQ_CONTROL_FLOW_EXCEPTIONS:
147144
scope.transaction.set_status(SPANSTATUS.ABORTED)
148145
return

0 commit comments

Comments
 (0)