10000 fix: Log response body in transport (#321) · pythonthings/sentry-python@dc16b4b · GitHub
[go: up one dir, main page]

Skip to content

Commit dc16b4b

Browse files
authored
fix: Log response body in transport (getsentry#321)
* fix: Log response body in transport * fix: Formatting
1 parent c891674 commit dc16b4b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sentry_sdk/transport.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ def _send_event(self, event):
130130
return
131131

132132
elif response.status >= 300 or response.status < 200:
133-
raise ValueError("Unexpected status code: %s" % response.status)
133+
logger.error(
134+
"Unexpected status code: %s (body: %s)",
135+
response.status,
136+
response.data,
137+
)
134138
finally:
135139
response.close()
136140

0 commit comments

Comments
 (0)
0