📜  node js 处理未处理的承诺拒绝 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:37.441000             🧑  作者: Mango

代码示例1
process.on('unhandledRejection', (reason: Error | any, promise: Promise) => {
  console.log('Unhandled Rejection at:', promise, 'reason:', reason);
  // Application specific logging, throwing an error, or other logic here
});