Skip to content

Commit e9358af

Browse files
maclover7jasnell
authored andcommitted
errors: remove duplicate error definition
Also fixes error being (now!) properly thrown by alphabetize-errors. also properly enable lint rule Was not using proper magic comment syntax before! -URL: #15307 Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 973c12f commit e9358af

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

doc/api/errors.md

-5
Original file line numberDiff line numberDiff line change
@@ -1250,11 +1250,6 @@ Used when an attempt is made to launch a Node.js process with an unknown
12501250
by errors in user code, although it is not impossible. Occurrences of this error
12511251
are most likely an indication of a bug within Node.js itself.
12521252

1253-
<a id="ERR_VALUE_OUT_OF_RANGE"></a>
1254-
### ERR_VALUE_OUT_OF_RANGE
1255-
1256-
Used when a number value is out of range.
1257-
12581253
<a id="ERR_V8BREAKITERATOR"></a>
12591254
### ERR_V8BREAKITERATOR
12601255

lib/internal/errors.js

100644100755
+8-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-enable alphabetize-errors */
1+
/* eslint alphabetize-errors: "error" */
22

33
'use strict';
44

@@ -254,15 +254,15 @@ E('ERR_REQUIRE_ESM', 'Must use import to load ES Module: %s');
254254
E('ERR_SERVER_ALREADY_LISTEN',
255255
'Listen method has been called more than once without closing.');
256256
E('ERR_SOCKET_ALREADY_BOUND', 'Socket is already bound');
257-
E('ERR_SOCKET_BAD_PORT', 'Port should be > 0 and < 65536');
258257
E('ERR_SOCKET_BAD_BUFFER_SIZE', 'Buffer size must be a positive integer');
258+
E('ERR_SOCKET_BAD_PORT', 'Port should be > 0 and < 65536');
259259
E('ERR_SOCKET_BAD_TYPE',
260260
'Bad socket type specified. Valid types are: udp4, udp6');
261+
E('ERR_SOCKET_BUFFER_SIZE',
262+
(reason) => `Could not get or set buffer size: ${reason}`);
261263
E('ERR_SOCKET_CANNOT_SEND', 'Unable to send data');
262264
E('ERR_SOCKET_CLOSED', 'Socket is closed');
263265
E('ERR_SOCKET_DGRAM_NOT_RUNNING', 'Not running');
264-
E('ERR_SOCKET_BUFFER_SIZE',
265-
(reason) => `Could not get or set buffer size: ${reason}`);
266266
E('ERR_STDERR_CLOSE', 'process.stderr cannot be closed');
267267
E('ERR_STDOUT_CLOSE', 'process.stdout cannot be closed');
268268
E('ERR_STREAM_WRAP', 'Stream has StringDecoder set or is in objectMode');
@@ -285,12 +285,13 @@ E('ERR_UNKNOWN_ENCODING', 'Unknown encoding: %s');
285285
E('ERR_UNKNOWN_SIGNAL', 'Unknown signal: %s');
286286
E('ERR_UNKNOWN_STDIN_TYPE', 'Unknown stdin file type');
287287
E('ERR_UNKNOWN_STREAM_TYPE', 'Unknown stream file type');
288+
E('ERR_V8BREAKITERATOR', 'Full ICU data not installed. ' +
289+
'See https://github.com/nodejs/node/wiki/Intl');
290+
E('ERR_VALID_PERFORMANCE_ENTRY_TYPE',
291+
'At least one valid performance entry type is required');
288292
E('ERR_VALUE_OUT_OF_RANGE', (start, end, value) => {
289293
return `The value of "${start}" must be ${end}. Received "${value}"`;
290294
});
291-
E('ERR_VALID_PERFORMANCE_ENTRY_TYPE',
292-
'At least one valid performance entry type is required');
293-
E('ERR_VALUE_OUT_OF_RANGE', 'The value of "%s" must be %s. Received "%s"');
294295

295296
function invalidArgType(name, expected, actual) {
296297
internalAssert(name, 'name is required');

0 commit comments

Comments
 (0)