diff --git a/src/index.ts b/src/index.ts index d633fcbbcb..bcd6561691 100644 --- a/src/index.ts +++ b/src/index.ts @@ -194,7 +194,12 @@ cluster.on('exit', worker => { // Display detail of unhandled promise rejection process.on('unhandledRejection', console.dir); -// Dying away... -process.on('exit', () => { - Logger.info('The process is going exit'); +// Display detail of uncaught exception +process.on('uncaughtException', err => { + console.error(err); +}); + +// Dying away... +process.on('exit', code => { + Logger.info(`The process is going exit (${code})`); });