mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
console: fixup error message
Use "options.inspectOptions" instead of just "inspectOptions" Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32475 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
1 parent
b85bc0cc02
commit
790841597d
3 files changed
+7
-4
No files matched your search
@@ -104,11 +104,14 @@ function Console(options /* or: stdout, stderr, ignoreErrors = true */) {
|
||||
if (inspectOptions.colors !== undefined &&
|
||||
options.colorMode !== undefined) {
|
||||
throw new ERR_INCOMPATIBLE_OPTION_PAIR(
|
||||
'inspectOptions.color', 'colorMode');
|
||||
'options.inspectOptions.color', 'colorMode');
|
||||
}
|
||||
optionsMap.set(this, inspectOptions);
|
||||
} else if (inspectOptions !== undefined) {
|
||||
throw new ERR_INVALID_ARG_TYPE('inspectOptions', 'object', inspectOptions);
|
||||
throw new ERR_INVALID_ARG_TYPE(
|
||||
'options.inspectOptions',
|
||||
'object',
|
||||
inspectOptions);
|
||||
}
|
||||
|
||||
// Bind the prototype functions to this Console instance
|
||||
|
||||
@@ -140,7 +140,7 @@ out.write = err.write = (d) => {};
|
||||
});
|
||||
},
|
||||
{
|
||||
message: 'The "inspectOptions" argument must be of type object.' +
|
||||
message: 'The "options.inspectOptions" property must be of type object.' +
|
||||
common.invalidArgTypeHelper(inspectOptions),
|
||||
code: 'ERR_INVALID_ARG_TYPE'
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ check(false, false, false);
|
||||
});
|
||||
},
|
||||
{
|
||||
message: 'Option "inspectOptions.color" cannot be used in ' +
|
||||
message: 'Option "options.inspectOptions.color" cannot be used in ' +
|
||||
'combination with option "colorMode"',
|
||||
code: 'ERR_INCOMPATIBLE_OPTION_PAIR'
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user