Skip to content

Commit 814d88a

Browse files
jasnelladdaleax
authored andcommitted
console: fixup error message
Use "options.inspectOptions" instead of just "inspectOptions" Signed-off-by: James M Snell <[email protected]> PR-URL: #32475 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 8770fd9 commit 814d88a

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

lib/internal/console/constructor.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,14 @@ function Console(options /* or: stdout, stderr, ignoreErrors = true */) {
110110
if (inspectOptions.colors !== undefined &&
111111
options.colorMode !== undefined) {
112112
throw new ERR_INCOMPATIBLE_OPTION_PAIR(
113-
'inspectOptions.color', 'colorMode');
113+
'options.inspectOptions.color', 'colorMode');
114114
}
115115
optionsMap.set(this, inspectOptions);
116116
} else if (inspectOptions !== undefined) {
117-
throw new ERR_INVALID_ARG_TYPE('inspectOptions', 'object', inspectOptions);
117+
throw new ERR_INVALID_ARG_TYPE(
118+
'options.inspectOptions',
119+
'object',
120+
inspectOptions);
118121
}
119122

120123
// Bind the prototype functions to this Console instance

test/parallel/test-console-instance.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ out.write = err.write = (d) => {};
140140
});
141141
},
142142
{
143-
message: 'The "inspectOptions" argument must be of type object.' +
143+
message: 'The "options.inspectOptions" property must be of type object.' +
144144
common.invalidArgTypeHelper(inspectOptions),
145145
code: 'ERR_INVALID_ARG_TYPE'
146146
}

test/parallel/test-console-tty-colors.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ check(false, false, false);
8686
});
8787
},
8888
{
89-
message: 'Option "inspectOptions.color" cannot be used in ' +
89+
message: 'Option "options.inspectOptions.color" cannot be used in ' +
9090
'combination with option "colorMode"',
9191
code: 'ERR_INCOMPATIBLE_OPTION_PAIR'
9292
}

0 commit comments

Comments
 (0)