Skip to content

Commit c64e2ee

Browse files
simplify
1 parent 44d1619 commit c64e2ee

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

sentry_sdk/integrations/asgi.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def __init__(
106106
span_origin: str = "manual",
107107
http_methods_to_capture: "Tuple[str, ...]" = DEFAULT_HTTP_METHODS_TO_CAPTURE,
108108
asgi_version: "Optional[int]" = None,
109-
suppress_chained_exceptions: "Optional[bool]" = None,
109+
suppress_chained_exceptions: "bool" = True,
110110
) -> None:
111111
"""
112112
Instrument an ASGI application with Sentry. Provides HTTP/websocket
@@ -192,10 +192,7 @@ async def _run_app(
192192
return await self.app(scope, receive, send)
193193

194194
except Exception as exc:
195-
if (
196-
self.suppress_chained_exceptions is None
197-
or self.suppress_chained_exceptions
198-
):
195+
if self.suppress_chained_exceptions:
199196
self._capture_lifespan_exception(exc)
200197
raise exc from None
201198

@@ -337,10 +334,7 @@ async def _sentry_wrapped_send(
337334
scope, receive, _sentry_wrapped_send
338335
)
339336
except Exception as exc:
340-
if (
341-
self.suppress_chained_exceptions is None
342-
or self.suppress_chained_exceptions
343-
):
337+
if self.suppress_chained_exceptions:
344338
self._capture_lifespan_exception(exc)
345339
raise exc from None
346340

0 commit comments

Comments
 (0)