mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
17 lines
494 B
JavaScript
17 lines
494 B
JavaScript
|
/**
|
||
|
* 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 };
|