在 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)