Skip to content

Commit 30d6a38

Browse files
committed
fix(wsgi): Dont crash when trying to build URL for request
1 parent 66ffc91 commit 30d6a38

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sentry_sdk/integrations/_wsgi_common.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ def extract_into_event(self, event):
1616

1717
content_length = self.content_length()
1818
request_info = event.setdefault("request", {})
19-
request_info["url"] = self.url()
19+
try:
20+
request_info["url"] = self.url()
21+
except Exception:
22+
# Django sometimes crashes with KeyError trying to build an
23+
# absolute URL
24+
pass
2025

2126
if _should_send_default_pii():
2227
request_info["cookies"] = dict(self.cookies())

0 commit comments

Comments
 (0)