Skip to content

Commit 408255f

Browse files
fix(wsgi): Do not catch None
1 parent bda7d82 commit 408255f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

sentry_sdk/integrations/_wsgi_common.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99

1010
try:
1111
from django.http.request import RawPostDataException
12+
13+
_RAW_DATA_EXCEPTIONS = (RawPostDataException, ValueError)
1214
except ImportError:
1315
RawPostDataException = None
16+
_RAW_DATA_EXCEPTIONS = (ValueError,)
1417

1518
from typing import TYPE_CHECKING
1619

@@ -110,7 +113,7 @@ def extract_into_event(self, event: "Event") -> None:
110113
raw_data = None
111114
try:
112115
raw_data = self.raw_data()
113-
except (RawPostDataException, ValueError):
116+
except _RAW_DATA_EXCEPTIONS:
114117
# If DjangoRestFramework is used it already read the body for us
115118
# so reading it here will fail. We can ignore this.
116119
pass

0 commit comments

Comments
 (0)