mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
process: improve hrtime() error message
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: https://github.com/nodejs/node/pull/14324 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
This commit is contained in:
1 parent
7fdcb68dc3
commit
43e105f645
2 files changed
+5
-6
No files matched your search
@@ -114,10 +114,9 @@ E('ERR_HTTP_TRAILER_INVALID',
|
||||
E('ERR_INDEX_OUT_OF_RANGE', 'Index out of range');
|
||||
E('ERR_INVALID_ARG_TYPE', invalidArgType);
|
||||
E('ERR_INVALID_ARRAY_LENGTH',
|
||||
(name, length, actual) => {
|
||||
(name, len, actual) => {
|
||||
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 of length ${len}.`;
|
||||
});
|
||||
E('ERR_INVALID_BUFFER_SIZE', 'Buffer size must be a multiple of %s');
|
||||
E('ERR_INVALID_CALLBACK', 'Callback must be a function');
|
||||
|
||||
Reference in new issue
Block a user