小编Aka*_*dey的帖子

Node.js Sentry 错误捕获不起作用

在 Node.js 8 中,如果我在代码末尾使用 process.exit(0) ,我将无法捕获哨兵上的错误。否则它工作正常

const Sentry = require('@sentry/node');
Sentry.init({ dsn: 'https://c3f5****************34dbf@sentry.io/1288850' });
try{
    throw new Error('test-error');
}
catch(e){
    const Eid = Sentry.captureException(e);
    console.log(Eid);
}
process.exit(0);
Run Code Online (Sandbox Code Playgroud)

node.js sentry

0
推荐指数
1
解决办法
1349
查看次数

标签 统计

node.js ×1

sentry ×1