Skip to content

Commit d6a3824

Browse files
committed
Do not override an existing error status
1 parent c65f6c5 commit d6a3824

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sentry_sdk/tracing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,8 @@ def __enter__(self):
416416
def __exit__(self, ty, value, tb):
417417
# type: (Optional[Any], Optional[Any], Optional[Any]) -> None
418418
if value is not None and should_be_treated_as_error(ty, value):
419-
self.set_status(SPANSTATUS.INTERNAL_ERROR)
419+
if self.status != SPANSTATUS.ERROR:
420+
self.set_status(SPANSTATUS.INTERNAL_ERROR)
420421

421422
with capture_internal_exceptions():
422423
scope, old_span = self._context_manager_state

0 commit comments

Comments
 (0)