Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: improve error message of _errnoException #17626

Closed
wants to merge 2 commits into from

Conversation

starkwang
Copy link
Contributor

@starkwang starkwang commented Dec 12, 2017

The usage of ERR_INVALID_ARG_TYPE in _errnoException is a little inappropriate. This change is to improve it.

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

util

@nodejs-github-bot nodejs-github-bot added the util Issues and PRs related to the built-in util module. label Dec 12, 2017
@Trott Trott added semver-major PRs that contain breaking changes and should be released in the next major version. tsc-review labels Dec 12, 2017
@Trott
Copy link
Member

Trott commented Dec 12, 2017

Out of caution, labeling semver-major. However, I definitely see a case for patch on this one. I believe our policy is that if an error code changes, it's considered a breaking change unless the TSC says otherwise.

@nodejs/tsc: I think this one should be patch rather than major. Is there consensus on that? If so, I'll remove the semver-major label.

Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

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

LGTM with one suggestion

lib/util.js Outdated
}
if (err >= 0 || !Number.isSafeInteger(err)) {
throw new errors.RangeError('ERR_VALUE_OUT_OF_RANGE', 'err',
'a negative number', err);
Copy link
Member

Choose a reason for hiding this comment

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

Since there is an integer check and the type name is already in prose style, maybe change this to 'a negative integer' for better clarity?

@joyeecheung
Copy link
Member

@Trott The changed error is new in v9.x, I doubt this change could cause any serious breakage, so I am +1 on marking this semver-patch.

@jasnell
Copy link
Member

jasnell commented Dec 28, 2017

I'd prefer this as semver-major

@jasnell
Copy link
Member

jasnell commented Dec 28, 2017

@starkwang
Copy link
Contributor Author

CI seems failed. I'm fixing it.

The usage of ERR_INVALID_ARG_TYPE in _errnoException
is a little inappropriate. This change is to improve it.
@starkwang
Copy link
Contributor Author

@starkwang
Copy link
Contributor Author

Landed in c64ca56

@starkwang starkwang closed this Dec 29, 2017
starkwang added a commit that referenced this pull request Dec 29, 2017
The usage of ERR_INVALID_ARG_TYPE in _errnoException
is a little inappropriate. This change is to improve it.

PR-URL: #17626
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@Trott Trott removed the tsc-review label Dec 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-major PRs that contain breaking changes and should be released in the next major version. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants