Skip to content

Commit f922864

Browse files
committed
ref(boto3): remove redundant span checks during enrichment
1 parent 6888b5d commit f922864

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

‎sentry_sdk/integrations/boto3/_client.py‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,12 @@ def sentry_patched_make_api_call(
9393
try:
9494
parsed = orig_make_api_call(self, operation_name, api_params)
9595
except BaseException as error:
96-
if span is not None:
97-
with capture_internal_exceptions():
98-
_set_span_attributes(span, _get_error_attributes(error))
96+
with capture_internal_exceptions():
97+
_set_span_attributes(span, _get_error_attributes(error))
9998
raise
10099
else:
101-
if span is not None:
102-
with capture_internal_exceptions():
103-
_set_span_attributes(span, _get_response_attributes(parsed))
100+
with capture_internal_exceptions():
101+
_set_span_attributes(span, _get_response_attributes(parsed))
104102
except BaseException as error:
105103
# finish `StreamedSpan` explicitly; static spans are finished by
106104
# their context manager.

0 commit comments

Comments
 (0)