[英]How to interpret the node code and rejection id on a Unhandled Promise Rejection Warning?
When running a unit test on a typescript service I am seeing this warning: 在打字稿服务上运行单元测试时,我看到此警告:
(node:79377) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): [object Object]
What does node:
tell me? node:
告诉我什么? Also, what does rejection id:
tell me? 另外,
rejection id:
告诉我什么?
--NOTE-- - 注意 -
My question is not how to find the unhandled promise, but what the "numbers" in the warning communicate. 我的问题不是如何找到未兑现的承诺,而是警告中的“数字”传达了什么。
(node:79377)
is node
PID (process ID) https://github.com/nodejs/node/blob/master/lib/internal/process/warning.js#L4 (node:79377)
是node
PID(进程ID) https://github.com/nodejs/node/blob/master/lib/internal/process/warning.js#L4
rejection id
is id of rejected Promise
https://github.com/nodejs/node/blob/master/lib/internal/process/promises.js#L40 grab Promise ID
https://github.com/nodejs/node/blob/master/lib/internal/process/promises.js#L63 generate warning/error rejection id
是被拒绝的ID Promise
https://github.com/nodejs/node/blob/master/lib/internal/process/promises.js#L40抢Promise ID
https://github.com/nodejs/node/blob /master/lib/internal/process/promises.js#L63生成警告/错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.