|
5 | 5 | from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version |
6 | 6 | from sentry_sdk.integrations.logging import ignore_logger |
7 | 7 | from sentry_sdk.scope import should_send_default_pii |
8 | | -from sentry_sdk.traces import SegmentSource, SpanStatus |
| 8 | +from sentry_sdk.traces import SegmentSource |
9 | 9 | from sentry_sdk.tracing import Transaction, TransactionSource |
10 | 10 | from sentry_sdk.tracing_utils import has_span_streaming_enabled |
11 | 11 | from sentry_sdk.utils import ( |
12 | 12 | SENSITIVE_DATA_SUBSTITUTE, |
| 13 | + _register_control_flow_exception, |
13 | 14 | capture_internal_exceptions, |
14 | 15 | ensure_integration_enabled, |
15 | 16 | event_from_exception, |
@@ -61,6 +62,8 @@ def setup_once() -> None: |
61 | 62 | patch_run_job() |
62 | 63 | patch_create_worker() |
63 | 64 |
|
| 65 | + _register_control_flow_exception(ARQ_CONTROL_FLOW_EXCEPTIONS) |
| 66 | + |
64 | 67 | ignore_logger("arq.worker") |
65 | 68 |
|
66 | 69 |
|
@@ -136,13 +139,7 @@ async def _sentry_run_job(self: "Worker", job_id: str, score: int) -> None: |
136 | 139 | def _capture_exception(exc_info: "ExcInfo") -> None: |
137 | 140 | scope = sentry_sdk.get_current_scope() |
138 | 141 |
|
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: |
146 | 143 | if exc_info[0] in ARQ_CONTROL_FLOW_EXCEPTIONS: |
147 | 144 | scope.transaction.set_status(SPANSTATUS.ABORTED) |
148 | 145 | return |
|
0 commit comments