errors: alter ERR_INVALID_CURSOR_POS
Changes the base instance for ERR_INVALID_CURSOR_POS from Error to TypeError as a more accurate representation of the error. PR-URL: https://github.com/nodejs/node/pull/19960 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
parent
15e136d9c5
commit
31d6cec60e
@ -879,10 +879,8 @@ E('ERR_INVALID_BUFFER_SIZE',
|
||||
'Buffer size must be a multiple of %s', RangeError);
|
||||
E('ERR_INVALID_CALLBACK', 'Callback must be a function', TypeError);
|
||||
E('ERR_INVALID_CHAR', invalidChar, TypeError);
|
||||
|
||||
// This should probably be a `TypeError`.
|
||||
E('ERR_INVALID_CURSOR_POS',
|
||||
'Cannot set cursor row without setting its column', Error);
|
||||
'Cannot set cursor row without setting its column', TypeError);
|
||||
E('ERR_INVALID_DOMAIN_NAME', 'Unable to determine the domain name', TypeError);
|
||||
E('ERR_INVALID_FD',
|
||||
'"fd" must be a positive integer: %s', RangeError);
|
||||
|
@ -77,7 +77,7 @@ writable.data = '';
|
||||
common.expectsError(
|
||||
() => readline.cursorTo(writable, 'a', 1),
|
||||
{
|
||||
type: Error,
|
||||
type: TypeError,
|
||||
code: 'ERR_INVALID_CURSOR_POS',
|
||||
message: 'Cannot set cursor row without setting its column'
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user