|
17 | 17 | from sentry_sdk.consts import OP, SPANDATA |
18 | 18 | from sentry_sdk.integrations import _check_minimum_version, DidNotEnable, Integration |
19 | 19 | from sentry_sdk.scope import should_send_default_pii |
20 | | -from sentry_sdk.tracing_utils import set_span_errored |
21 | 20 | from sentry_sdk.utils import ( |
22 | 21 | capture_internal_exceptions, |
23 | 22 | event_from_exception, |
@@ -195,8 +194,6 @@ def setup_once() -> None: |
195 | 194 |
|
196 | 195 |
|
197 | 196 | def _capture_exception(exc: "Any") -> None: |
198 | | - set_span_errored() |
199 | | - |
200 | 197 | event, hint = event_from_exception( |
201 | 198 | exc, |
202 | 199 | client_options=sentry_sdk.get_client().options, |
@@ -633,7 +630,7 @@ def _sentry_patched_create_sync(f: "Any", *args: "Any", **kwargs: "Any") -> "Any |
633 | 630 | exc_info = sys.exc_info() |
634 | 631 | with capture_internal_exceptions(): |
635 | 632 | _capture_exception(exc) |
636 | | - span.__exit__(None, None, None) |
| 633 | + span.__exit__(*exc_info) |
637 | 634 | reraise(*exc_info) |
638 | 635 |
|
639 | 636 | if isinstance(result, Stream): |
@@ -721,7 +718,7 @@ async def _sentry_patched_create_async( |
721 | 718 | exc_info = sys.exc_info() |
722 | 719 | with capture_internal_exceptions(): |
723 | 720 | _capture_exception(exc) |
724 | | - span.__exit__(None, None, None) |
| 721 | + span.__exit__(*exc_info) |
725 | 722 | reraise(*exc_info) |
726 | 723 |
|
727 | 724 | if isinstance(result, AsyncStream): |
|
0 commit comments