fix(errors): now handles uncaught errors

This commit is contained in:
Philipp Kunz 2018-11-01 23:44:49 +01:00
parent f1528a799b
commit f041623403

View File

@ -17,6 +17,15 @@ export class Sentry {
plugins.sentry.init({ plugins.sentry.init({
dsn: optionsArg.dsn dsn: optionsArg.dsn
}); });
process
.on('unhandledRejection', (reason, p) => {
console.error(reason, 'Unhandled Rejection at Promise', p);
})
.on('uncaughtException', err => {
console.log(err);
this.captureException(err);
process.exit(1);
});
} }
captureException(exceptionArg: any) { captureException(exceptionArg: any) {