fix(errors): now handles uncaught errors
This commit is contained in:
parent
f1528a799b
commit
f041623403
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user