-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Conversation
Out of caution, labeling @nodejs/tsc: I think this one should be patch rather than major. Is there consensus on that? If so, I'll remove the |
There was a problem hiding this 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); |
There was a problem hiding this comment.
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?
@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. |
cdf951d
to
9c8a78c
Compare
I'd prefer this as semver-major |
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.
9c8a78c
to
8e7d18e
Compare
Landed in c64ca56 |
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]>
The usage of ERR_INVALID_ARG_TYPE in _errnoException is a little inappropriate. This change is to improve it.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
util