mirror of
https://github.com/wassname/talk.git
synced 2026-07-16 11:22:16 +08:00
more extreme error exiting for rejected promise that are not handled
This commit is contained in:
@@ -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
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user