-
Notifications
You must be signed in to change notification settings - Fork 30k
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
process: improve hrtime() error message #14324
Conversation
Labeled HOWEVER, it does not really matter for this PR either way because the error message that this changes is not in Node.js 8.0 and is itself semver-major. In other words, whether we land this PR or not, the message is going to change in a semver-major fashion in Node.js 9.0 |
Is there a particular reason apart from reducing the error message length? The original seems ok to me. |
Could be more concise, aren't we Imo not worth the major change for this though, pretty much just the same thing? |
@lpinca In addition to reducing the error message length, I'm of the opinion that the current message is awkward. I was originally going to fix that by simply changing |
@Fishrock123 #13937 especially #13937 (comment) There are at least 4 CTC members who believe these changes should still be semver-major at this time, and there are at least 2 who believe they should be semver-patch. So there is not consensus. Thus, I labeled this semver-major based on the "if there's any doubt, then it's major" principle. |
@Fishrock123 As I wrote above, the semver major that introduces this error message in the first place has not landed. So the "not worth the major change" is not the right way to think about this, as the semver cost is zero. I'm making a (tiny) semver-major change to another semver-major change and they're both going to land in 9.0. |
Needs one more @nodejs/ctc approval, so ping! |
lib/internal/errors.js
Outdated
@@ -126,8 +126,7 @@ E('ERR_INVALID_ARRAY_LENGTH', | |||
(name, length, actual) => { | |||
const assert = lazyAssert(); | |||
assert.strictEqual(typeof actual, 'number'); | |||
return `The "${name}" array must have a length of ${ | |||
length}. Received length ${actual}`; | |||
return `The array "${name}" (length ${actual}) must be length ${length}.`; |
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.
Shouldn't it be must have length
or must be of length
?
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.
+1 to must be of length
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.
OK, updated with that text.
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
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
Change error message from the form this format: The "time" array must have a length of 2. Received length 0 ...to this format: The array "time" (length 0) must be of length 2.
Landed in 43e105f |
Change error message from the form this format: The "time" array must have a length of 2. Received length 0 ...to this format: The array "time" (length 0) must be of length 2. PR-URL: nodejs#14324 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Change error message from the form this format:
...to this format:
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
process errors test