Skip to content

Commit

Permalink
errors: alter ERR_INVALID_CURSOR_POS
Browse files Browse the repository at this point in the history
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 <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>
  • Loading branch information
davidmarkclements authored and jasnell committed Apr 17, 2018
1 parent 77f3c1f commit 5135e24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-readline-csi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
});
Expand Down

0 comments on commit 5135e24

Please sign in to comment.