more extreme error exiting for rejected promise that are not handled

This commit is contained in:
Wyatt Johnson
2018-01-25 10:17:26 -07:00
parent 1e517469c3
commit de9383e657
2 changed files with 2 additions and 18 deletions
-17
View File
@@ -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');
// }
// });
+2 -1
View File
@@ -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);
});