📜  表达未捕获异常 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:29.595000             🧑  作者: Mango

代码示例1
process
  .on('unhandledRejection', (reason, p) => {
    console.error(reason, 'Unhandled Rejection at Promise', p);
  })
  .on('uncaughtException', err => {
    console.error(err, 'Uncaught Exception thrown');
    process.exit(1);
  });