From de9383e657c42f83f742e81bd897adc8023e8e17 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 25 Jan 2018 10:17:26 -0700 Subject: [PATCH] more extreme error exiting for rejected promise that are not handled --- bin/cli | 17 ----------------- bin/util.js | 3 ++- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/bin/cli b/bin/cli index 6237d4740..b61c529c5 100755 --- a/bin/cli +++ b/bin/cli @@ -41,20 +41,3 @@ if (!commands.includes(command)) { } process.exit(1); } - -// /** -// * When this process exists, check to see if we have a running command, if we do -// * check to see if it is still running. If it is, then kill it with a SIGINT -// * signal. This is for the use case where we want to kill the process that is -// * labeled with the PID written out by the parent process. -// */ -// process.once('exit', () => { -// if ( - -// // program.runningCommand && -// program.runningCommand.killed === false && -// program.runningCommand.exitCode === null -// ) { -// program.runningCommand.kill('SIGINT'); -// } -// }); diff --git a/bin/util.js b/bin/util.js index 0a9adb966..e80f123a5 100644 --- a/bin/util.js +++ b/bin/util.js @@ -63,5 +63,6 @@ process.once('SIGUSR2', () => util.shutdown(0, 'SIGUSR2')); // ignoring them. In the future, promise rejections that are not handled will // terminate the Node.js process with a non-zero exit code. process.on('unhandledRejection', err => { - throw err; + console.error(err); + process.exit(1); });