如何找到哪个 Future 导致 "Future exception was never retrieved"
How to find which Future caused "Future exception was never retrieved"
[15:29:19] Future exception was never retrieved
future: <Future finished exception=ConnectionError('Connection to Telegram failed 1 time(s)')>
Traceback (most recent call last):
File "/Users/me/Desktop/project/file.py", line 72, in _connect
await client.connect()
File "/Users/me/Desktop/project/resources/venv/lib/python3.7/site-packages/telethon/client/telegrambaseclient.py", line 551, in connect
LAYER, self._init_request
ConnectionError: Connection to Telegram failed 1 time(s)
如何找到从未检索到异常的确切 Future 对象?我只能看到确切的异常和一些堆栈跟踪(我无法从中找到 Future 本身)。如果我能知道 Future 在代码中的何处定义,那就太好了。
启用调试模式会显示 Future 的创建位置。
https://docs.python.org/3.7/library/asyncio-dev.html#debug-mode
[15:29:19] Future exception was never retrieved
future: <Future finished exception=ConnectionError('Connection to Telegram failed 1 time(s)')>
Traceback (most recent call last):
File "/Users/me/Desktop/project/file.py", line 72, in _connect
await client.connect()
File "/Users/me/Desktop/project/resources/venv/lib/python3.7/site-packages/telethon/client/telegrambaseclient.py", line 551, in connect
LAYER, self._init_request
ConnectionError: Connection to Telegram failed 1 time(s)
如何找到从未检索到异常的确切 Future 对象?我只能看到确切的异常和一些堆栈跟踪(我无法从中找到 Future 本身)。如果我能知道 Future 在代码中的何处定义,那就太好了。
启用调试模式会显示 Future 的创建位置。 https://docs.python.org/3.7/library/asyncio-dev.html#debug-mode