📜  nodejs 捕获未捕获的异常 - Javascript 代码示例

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

代码示例1
process
    .on('uncaughtException', (err) => console.error(err, 'Uncaught Exception'))
    .on('unhandledRejection', (reason, promise) =>
        console.error(reason, 'Unhandled Rejection at', promise)
    );