Rocket1184 / qq-bot-rebown

[DEPRECATED!] SmartQQ robot written in JavaScript, using ES7 async/await features
https://web2.qq.com/
MIT License
56 stars 17 forks source link

程序崩溃 #25

Closed JImumu closed 6 years ago

JImumu commented 6 years ago

错误信息如下: (node:2200) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Request failed with status code 504 (node:2200) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

rocka commented 6 years ago

这个错误是在做什么的时候出现的?能不能贴一下日志的上下文?

JImumu commented 6 years ago

错误大概出现在登录后的20个小时

这是错误信息的上一条日志 [Mon Mar 26 2018 09:42:18 GMT+0800 (中国标准时间)] INFO 保存 Cookie 到 C:\Users\ ADMINI~1\AppData\Local\Temp\2\qq-bot.cookie

JImumu commented 6 years ago

猜测是某条request 504,然后Unhandled promise rejections are deprecated

rocka commented 6 years ago

错误信息的上一条日志是保存 Cookie 的话,是不是这一段时间都没有收到过消息?

我遇到过出现 504 错误的情况,是在轮询消息时出现的,也做过处理:

https://github.com/Rocket1184/qq-bot-rebown/blob/3dcd4672a3709345ca5f86742cab8430400ed092/src/qq/index.js#L540

其他的情况就没有遇到过了。重启一下程序看看能否复现?启动程序时设置环境变量 LOG_LEVELdebug 可以打印更详细的日志。