Skip to content

Commit

Permalink
fix: sentry process error reporting (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
Viiprogrammer authored Mar 29, 2022
1 parent 090bb9f commit acd727f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,22 @@ main().catch((error) => {
console.log(error); // eslint-disable-line no-console
});

process.on('uncaughtException', (error) => {
process.on('uncaughtException', async (error) => {
Sentry.captureException(error, {
tags: {
type: 'process',
},
});
await Sentry.close(2000)
process.exit(1);
});

process.on('unhandledRejection', (error) => {
process.on('unhandledRejection', async (error) => {
Sentry.captureException(error, {
tags: {
type: 'process',
},
});
await Sentry.close(2000)
process.exit(1);
});

0 comments on commit acd727f

Please sign in to comment.