Skip to content

Commit a394e2f

Browse files
committed
Forgot to also update the async client
1 parent a632a81 commit a394e2f

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

sentry_sdk/integrations/httpx.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,13 @@ async def send(
205205
else:
206206
request.headers[key] = value
207207

208-
rv = await real_send(self, request, **kwargs)
209-
210-
streamed_span.status = "error" if rv.status_code >= 400 else "ok"
211-
attributes["http.response.status_code"] = rv.status_code
208+
try:
209+
rv = await real_send(self, request, **kwargs)
212210

213-
streamed_span.set_attributes(attributes)
211+
streamed_span.status = "error" if rv.status_code >= 400 else "ok"
212+
attributes["http.response.status_code"] = rv.status_code
213+
finally:
214+
streamed_span.set_attributes(attributes)
214215

215216
# Needs to happen within the context manager as we want to attach the
216217
# final data before the span finishes and is sent for ingesting.

0 commit comments

Comments
 (0)