Skip to content

Commit 48415ad

Browse files
committed
Catch any raised exceptions from the serialization json.dumps call and do not set the request.body.data attribute in that scenario
1 parent 29de949 commit 48415ad

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

sentry_sdk/integrations/starlette.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,12 @@ def event_processor(
521521
and not isinstance(current_span, NoOpStreamedSpan)
522522
):
523523
data = info["data"]
524-
current_span._segment.set_attribute(
525-
"http.request.body.data",
526-
_serialize_body_data(data),
527-
)
524+
525+
with capture_internal_exceptions():
526+
current_span._segment.set_attribute(
527+
"http.request.body.data",
528+
_serialize_body_data(data),
529+
)
528530

529531
return await old_func(*args, **kwargs)
530532

0 commit comments

Comments
 (0)