Description
@sentry/node version: 4.1.1
Node.js version: 10.9.0
Sentry exits my process after an uncaught exception even I provide my own implementation of onFatalError. How can I prevent that?
Here is a minimal working example. Without sentry.init
I get to the 2nd throw. With it the process finisches after the 1st one.
const sentry = require('@sentry/node');
sentry.init(
{ dsn: 'https://[email protected]/2',
integrations: [new sentry.Integrations.OnUncaughtException({
onFatalError: error => {
console.log('an error occured', error);
}
})]
}
);
process.on('uncaughtException', err => {
console.log(err, 'Uncaught Exception thrown');
// process.exit(1);
});
console.log("before throwing the first time")
setTimeout(() => { throw 42 }, 2000)
setTimeout(() => { console.log('still running') }, 10000)
throw 42;