2 Commits

Author SHA1 Message Date
e1262c2ca4 1.0.4 2018-11-01 23:44:49 +01:00
f041623403 fix(errors): now handles uncaught errors 2018-11-01 23:44:49 +01:00
3 changed files with 11 additions and 2 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "@mojoio/sentry",
"version": "1.0.3",
"version": "1.0.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@mojoio/sentry",
"version": "1.0.3",
"version": "1.0.4",
"private": false,
"description": "an unofficial abstraction package for sentry.io",
"main": "dist/index.js",

View File

@@ -17,6 +17,15 @@ export class Sentry {
plugins.sentry.init({
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) {