Skip to content

Commit 81afcea

Browse files
authored
Handle non-int exc.status_code in starlette (#2075)
1 parent a0f11e5 commit 81afcea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sentry_sdk/integrations/starlette.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ async def _sentry_patched_exception_handler(self, *args, **kwargs):
183183
exp = args[0]
184184

185185
is_http_server_error = (
186-
hasattr(exp, "status_code") and exp.status_code >= 500
186+
hasattr(exp, "status_code")
187+
and isinstance(exp.status_code, int)
188+
and exp.status_code >= 500
187189
)
188190
if is_http_server_error:
189191
_capture_exception(exp, handled=True)

0 commit comments

Comments
 (0)