diff --git a/lib/internal/debugger/inspect.js b/lib/internal/debugger/inspect.js index cddd0f426731d6..4c929bffc1550c 100644 --- a/lib/internal/debugger/inspect.js +++ b/lib/internal/debugger/inspect.js @@ -48,6 +48,7 @@ const { exitCodes: { kGenericUserError, kNoFailure, + kInvalidCommandLineArgument, }, } = internalBinding('errors'); @@ -344,7 +345,7 @@ function startInspect(argv = ArrayPrototypeSlice(process.argv, 2), console.error(` ${invokedAs} --port=`); console.error(` ${invokedAs} -p `); // TODO(joyeecheung): should be kInvalidCommandLineArgument. - process.exit(kGenericUserError); + process.exit(kInvalidCommandLineArgument); } const options = parseArgv(argv); diff --git a/lib/internal/main/repl.js b/lib/internal/main/repl.js index c371706b352c82..c77dfede89f49f 100644 --- a/lib/internal/main/repl.js +++ b/lib/internal/main/repl.js @@ -16,7 +16,7 @@ const console = require('internal/console/global'); const { getOptionValue } = require('internal/options'); -const { exitCodes: { kGenericUserError } } = internalBinding('errors'); +const { exitCodes: { kInvalidCommandLineArgument } } = internalBinding('errors'); prepareMainThreadExecution(); @@ -33,7 +33,7 @@ if (process.env.NODE_REPL_EXTERNAL_MODULE) { // so use console.error. console.error('Cannot specify --input-type for REPL'); // TODO(joyeecheung): should be kInvalidCommandLineArgument. - process.exit(kGenericUserError); + process.exit(kInvalidCommandLineArgument); } const esmLoader = require('internal/process/esm_loader'); diff --git a/src/node.cc b/src/node.cc index 3da63b5d511531..12fbca2321c6be 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1108,7 +1108,7 @@ ExitCode GenerateAndWriteSnapshotData(const SnapshotData** snapshot_data_ptr, "entry point but Node.js was built without embedded " "snapshot.\n"); // TODO(joyeecheung): should be kInvalidCommandLineArgument instead. - exit_code = ExitCode::kGenericUserError; + exit_code = ExitCode::kInvalidCommandLineArgument; return exit_code; } } else { @@ -1142,7 +1142,7 @@ ExitCode GenerateAndWriteSnapshotData(const SnapshotData** snapshot_data_ptr, "Cannot open %s for writing a snapshot.\n", snapshot_blob_path.c_str()); // TODO(joyeecheung): should be kStartupSnapshotFailure. - exit_code = ExitCode::kGenericUserError; + exit_code = ExitCode::kStartupSnapshotFailure; } return exit_code; } @@ -1166,7 +1166,7 @@ ExitCode LoadSnapshotDataAndRun(const SnapshotData** snapshot_data_ptr, if (!SnapshotData::FromBlob(read_data.get(), fp)) { // If we fail to read the customized snapshot, simply exit with 1. // TODO(joyeecheung): should be kStartupSnapshotFailure. - exit_code = ExitCode::kGenericUserError; + exit_code = ExitCode::kStartupSnapshotFailure; return exit_code; } *snapshot_data_ptr = read_data.release();