Skip to content

Commit

Permalink
improvement CLDSRV-466 add timestamp for exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulreddy authored and tmacro committed Nov 10, 2023
1 parent 4431505 commit b1b2d2a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
'use strict'; // eslint-disable-line strict

/**
* Catch uncaught exceptions and add timestamp to aid debugging
*/
process.on('uncaughtException', err => {
process.stderr.write(`${new Date().toISOString()}: Uncaught exception: \n${err.stack}`);
});

require('./lib/server.js')();

0 comments on commit b1b2d2a

Please sign in to comment.