触发 ApiError 后退出,偶发:Task exception was never retrieved
Wybxc opened this issue · 2 comments
Wybxc commented
Task exception was never retrieved
future: <Task finished name='Task-12' coro=<Mirai.send() done, defined at E:\YiriMiraiProject\YiriMirai\mirai\bot.py:310> exception=ApiError(6, '[ERROR 6]指定文件不存在。', '文件不存在:D:\\mirai\\mc\\test\\..\\test.png')>
Traceback (most recent call last):
File "E:\YiriMiraiProject\YiriMirai\mirai\bot.py", line 358, in send
await
File "E:\YiriMiraiProject\YiriMirai\mirai\models\api.py", line 390, in __call__
return await self.set(*args, **kwargs)
File "E:\YiriMiraiProject\YiriMirai\mirai\models\api.py", line 351, in set
return await self._call_api(
File "E:\YiriMiraiProject\YiriMirai\mirai\models\api.py", line 328, in _call_api
raw_response = await self.api_provider.call_api(
File "E:\YiriMiraiProject\YiriMirai\mirai\bot.py", line 79, in call_api
return await self._adapter.call_api(api, *args, **kwargs)
File "E:\YiriMiraiProject\YiriMirai\mirai\adapters\compose.py", line 54, in call_api
return await self.api_channel.call_api(api, method, **params)
File "E:\YiriMiraiProject\YiriMirai\mirai\adapters\http.py", line 235, in call_api
return await self._post(client, f'/{api}', params)
File "E:\YiriMiraiProject\YiriMirai\mirai\adapters\base.py", line 34, in wrapped
return await func(self, *args, **kwargs)
File "E:\YiriMiraiProject\YiriMirai\mirai\adapters\http.py", line 133, in _post
return _parse_response(response)
File "E:\YiriMiraiProject\YiriMirai\mirai\adapters\http.py", line 27, in _parse_response
raise exceptions.ApiError(result)
mirai.exceptions.ApiError: (6, '[ERROR 6]指定文件不存在。', '文件不存在:D:\\mirai\\mc\\test\\..\\test.png')
Wybxc commented
初步测试结果:在快速响应时触发 ApiError,才会出现这个错误
Wybxc commented
Fixed.