File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 33import sentry_sdk
44from sentry_sdk .consts import OP
55from sentry_sdk .integrations import Integration , DidNotEnable
6- from sentry_sdk .utils import event_from_exception , reraise
6+ from sentry_sdk .utils import event_from_exception , logger , reraise
77
88try :
99 import asyncio
@@ -74,9 +74,15 @@ async def _coro_creating_hub_and_span():
7474 return task
7575
7676 loop .set_task_factory (_sentry_task_factory ) # type: ignore
77+
7778 except RuntimeError :
7879 # When there is no running loop, we have nothing to patch.
79- pass
80+ logger .warning (
81+ "There is no running asyncio loop so there is nothing Sentry can patch. "
82+ "Please make sure you call sentry_sdk.init() within a running "
83+ "asyncio loop for the AsyncioIntegration to work. "
84+ "See https://docs.sentry.io/platforms/python/integrations/asyncio/"
85+ )
8086
8187
8288def _capture_exception ():
You can’t perform that action at this time.
0 commit comments