Skip to content

Commit

Permalink
[!!!Task] #18 add uncaughtExeption handler as last resort
Browse files Browse the repository at this point in the history
  • Loading branch information
Type-Style committed Feb 1, 2024
1 parent 003e57d commit dbbbb46
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,10 @@ app.use(error.handler);
// init server
app.listen(80, () => {
logger.log(`Server running //localhost:80, ENV: ${process.env.NODE_ENV}`, true);
});

process.on('uncaughtException', function(err) {
console.error('Caught exception:', err);
logger.error(err);
process.exit(1);
});

0 comments on commit dbbbb46

Please sign in to comment.