File tree 1 file changed +5
-2
lines changed
sentry_sdk/integrations/django
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 9
9
from django .core import signals
10
10
11
11
from sentry_sdk ._types import MYPY
12
- from sentry_sdk .utils import HAS_REAL_CONTEXTVARS
12
+ from sentry_sdk .utils import HAS_REAL_CONTEXTVARS , logger
13
13
14
14
if MYPY :
15
15
from typing import Any
@@ -287,7 +287,10 @@ def _patch_channels():
287
287
if not HAS_REAL_CONTEXTVARS :
288
288
# We better have contextvars or we're going to leak state between
289
289
# requests.
290
- raise RuntimeError (
290
+ #
291
+ # We cannot hard-raise here because channels may not be used at all in
292
+ # the current process.
293
+ logger .warning (
291
294
"We detected that you are using Django channels 2.0. To get proper "
292
295
"instrumentation for ASGI requests, the Sentry SDK requires "
293
296
"Python 3.7+ or the aiocontextvars package from PyPI."
You can’t perform that action at this time.
0 commit comments