Skip to content

Commit

Permalink
improvement CLDSRV-466 add timestamp for exceptions
Browse files Browse the repository at this point in the history
(cherry picked from commit b1b2d2a)
  • Loading branch information
rahulreddy authored and tmacro committed Apr 17, 2024
1 parent 53d143e commit 93ccc3d
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 93ccc3d

Please sign in to comment.