You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
494 B
16 lines
494 B
/**
|
|
* Exit the process with an error message.
|
|
*
|
|
* Note that this should be called before the process ends, but it will not
|
|
* itself end the process. This is because the Node.js documentation strongly
|
|
* advises against calling `process.exit` directly.
|
|
*
|
|
* @param {string} errorMessage - The error message that is causing the non-
|
|
* zero exit code.
|
|
*/
|
|
function exitWithError(errorMessage) {
|
|
console.error(errorMessage);
|
|
process.exitCode = 1;
|
|
}
|
|
|
|
module.exports = { exitWithError };
|
|
|