Skip to content

Commit 5135e24

Browse files
davidmarkclementsjasnell
authored andcommitted
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: #19960 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent 77f3c1f commit 5135e24

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/internal/errors.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -879,10 +879,8 @@ E('ERR_INVALID_BUFFER_SIZE',
879879
'Buffer size must be a multiple of %s', RangeError);
880880
E('ERR_INVALID_CALLBACK', 'Callback must be a function', TypeError);
881881
E('ERR_INVALID_CHAR', invalidChar, TypeError);
882-
883-
// This should probably be a `TypeError`.
884882
E('ERR_INVALID_CURSOR_POS',
885-
'Cannot set cursor row without setting its column', Error);
883+
'Cannot set cursor row without setting its column', TypeError);
886884
E('ERR_INVALID_DOMAIN_NAME', 'Unable to determine the domain name', TypeError);
887885
E('ERR_INVALID_FD',
888886
'"fd" must be a positive integer: %s', RangeError);

test/parallel/test-readline-csi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ writable.data = '';
7777
common.expectsError(
7878
() => readline.cursorTo(writable, 'a', 1),
7979
{
80-
type: Error,
80+
type: TypeError,
8181
code: 'ERR_INVALID_CURSOR_POS',
8282
message: 'Cannot set cursor row without setting its column'
8383
});

0 commit comments

Comments
 (0)