xx app > (node:111493) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by x x xx rejecting a promise which was not handled with .catch(). (rejection id: 21) x x xx PM2 > App [app] with id [0] and pid [111493], exited with code [0] via signal [SIGKILL] x x xx PM2 > Starting execution sequence in -fork mode- for app name:app id:0
node进程cpu 超过100%进程重启,rejecting a promise which was not handled with .catch() 错误 怎么解决?
发布于 7 年前 作者 jackieli123723 5679 次预览 最后一次回复是 7 年前 来自 问答
5 回复
promise 抛异常了咯,catch 处理一下
添加全局事件
找到位置,把未处理的promise异常处理掉
@carlisliu
这个错误处理没问题了
但是出现新的问题 程序还没运行完 就 killed 是什么原因呢?
@carlisliu 光这样处理可不够哦
先按日志fix bug,再上 Node.js 性能平台 做好监控,否则稳定性分分钟。。