Skip to content

Conversation

slammayjammay
Copy link
Contributor

@slammayjammay slammayjammay commented Feb 15, 2017

Migrate lib/readline.js to use internal/errors.js.

Refs: #11273

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

errors, readline

@nodejs-github-bot nodejs-github-bot added errors Issues and PRs related to JavaScript errors originated in Node.js core. readline Issues and PRs related to the built-in readline module. labels Feb 15, 2017
@jasnell jasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Feb 15, 2017
lib/readline.js Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is actually a RangeError? This looks like a ERR_INVALID_OPT_VALUE to me (refs: https://github.com/nodejs/node/pull/11300/files) too, but we can also make the message format of ERR_NON_NEGATIVE_NUMBER a function taking description of the variable that's negative, so we can keep the "historySize" part.

On another note, if we want to keep it as a ERR_NON_NEGATIVE_NUMBER, that code is missing documentation.

lib/readline.js Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the original message contains useful information(Argument "completer"), this looks like a ERR_INVALID_OPT_VALUE to me (refs: https://github.com/nodejs/node/pull/11300/files), passing the completer as an actual argument is not documented(refs: readline.createInterface()) so it doesn't fit the description of a Node.js style "callback" I think.

@jasnell jasnell added the blocked PRs that are blocked by other issues or PRs. label Apr 5, 2017
@fhinkel
Copy link
Member

fhinkel commented May 23, 2017

@slammayjammay Thanks so much for putting this together. Sorry that it is dragging out for so long due to being a semver-major change. Do you want to address the comments and rebase? Thanks!

@slammayjammay
Copy link
Contributor Author

@fhinkel Whoops, forgot about this! Sure, I'll find some time this week to address the feedback.

@slammayjammay slammayjammay force-pushed the internal-errors-readline branch 2 times, most recently from 049eaf2 to c4b4497 Compare May 24, 2017 05:16
@joyeecheung
Copy link
Member

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidental whitespace change?

@joyeecheung joyeecheung removed the blocked PRs that are blocked by other issues or PRs. label May 27, 2017
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to avoid using contractions in the error messages.

E('ERR_INVALID_CURSOR_POS',
   'Cannot set cursor row without setting its column');

@slammayjammay slammayjammay force-pushed the internal-errors-readline branch from 3fd0414 to 3a81d13 Compare May 31, 2017 00:36
@joyeecheung
Copy link
Member

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mhdawson
Copy link
Member

mhdawson commented Jun 6, 2017

@slammayjammay looks good, but unfortunately needs a rebase.

@slammayjammay slammayjammay force-pushed the internal-errors-readline branch from dac7cb0 to 4041b97 Compare June 7, 2017 03:17
@joyeecheung
Copy link
Member

jasnell pushed a commit that referenced this pull request Jun 13, 2017
PR-URL: #11390
Ref: #11273
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
@jasnell
Copy link
Member

jasnell commented Jun 13, 2017

Landed in 7f3f72c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

errors Issues and PRs related to JavaScript errors originated in Node.js core. readline Issues and PRs related to the built-in readline module. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants