Skip to content

Commit 33b11cc

Browse files
committed
Added docstrings to lifespan and request exception capture methods in SentryAsgiMiddleware for better clarity and support for derived integrations.
1 parent babfe27 commit 33b11cc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sentry_sdk/integrations/asgi.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,18 @@ def __init__(
147147

148148
def _capture_lifespan_exception(self, exc):
149149
# type: (Exception) -> None
150+
"""Capture exceptions from lifespan handlers.
151+
152+
The separate function is needed to support overriding in derived integrations that use different catching mechanisms.
153+
"""
150154
return _capture_exception(exc=exc, mechanism_type=self.mechanism_type)
151155

152156
def _capture_request_exception(self, exc):
153157
# type: (Exception) -> None
158+
"""Capture exceptions from request handlers.
159+
160+
The separate function is needed to support overriding in derived integrations that use different catching mechanisms.
161+
"""
154162
return _capture_exception(exc=exc, mechanism_type=self.mechanism_type)
155163

156164
def _run_asgi2(self, scope):

0 commit comments

Comments
 (0)