mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
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: https://github.com/nodejs/node/pull/15307 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
a14b252c5c
commit
0a8258b3de
2 files changed
+36
-13
No files matched your search
Regular → Executable
+16
@@ -998,6 +998,22 @@ Used when an attempt is made to launch a Node.js process with an unknown
|
||||
by errors in user code, although it is not impossible. Occurrences of this error
|
||||
are most likely an indication of a bug within Node.js itself.
|
||||
|
||||
<a id="ERR_V8BREAKITERATOR"></a>
|
||||
### ERR_V8BREAKITERATOR
|
||||
|
||||
Used when the V8 BreakIterator API is used but the full ICU data set is not
|
||||
installed.
|
||||
|
||||
<a id="ERR_VALID_PERFORMANCE_ENTRY_TYPE"></a>
|
||||
### ERR_VALID_PERFORMANCE_ENTRY_TYPE
|
||||
|
||||
Used by the Performance Timing API (`perf_hooks`) when no valid performance
|
||||
entry types were found.
|
||||
|
||||
<a id="ERR_VALUE_OUT_OF_RANGE"></a>
|
||||
### ERR_VALUE_OUT_OF_RANGE
|
||||
|
||||
Used when a given value is out of the accepted range.
|
||||
|
||||
[`ERR_INVALID_ARG_TYPE`]: #ERR_INVALID_ARG_TYPE
|
||||
[`subprocess.kill()`]: child_process.html#child_process_subprocess_kill_signal
|
||||
|
||||
Regular → Executable
+20
-13
@@ -1,4 +1,4 @@
|
||||
/* eslint-enable alphabetize-errors */
|
||||
/* eslint alphabetize-errors: "error" */
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -127,11 +127,11 @@ E('ERR_ENCODING_NOT_SUPPORTED',
|
||||
E('ERR_FALSY_VALUE_REJECTION', 'Promise was rejected with falsy value');
|
||||
E('ERR_HTTP_HEADERS_SENT',
|
||||
'Cannot render headers after they are sent to the client');
|
||||
E('ERR_HTTP_TRAILER_INVALID',
|
||||
'Trailers are invalid with this transfer encoding');
|
||||
E('ERR_HTTP_INVALID_CHAR', 'Invalid character in statusMessage.');
|
||||
E('ERR_HTTP_INVALID_STATUS_CODE',
|
||||
(originalStatusCode) => `Invalid status code: ${originalStatusCode}`);
|
||||
E('ERR_HTTP_TRAILER_INVALID',
|
||||
'Trailers are invalid with this transfer encoding');
|
||||
E('ERR_HTTP2_CONNECT_AUTHORITY',
|
||||
':authority header is required for CONNECT requests');
|
||||
E('ERR_HTTP2_CONNECT_PATH',
|
||||
@@ -150,10 +150,10 @@ E('ERR_HTTP2_HEADER_REQUIRED',
|
||||
(name) => `The ${name} header is required`);
|
||||
E('ERR_HTTP2_HEADER_SINGLE_VALUE',
|
||||
(name) => `Header field "${name}" must have only a single value`);
|
||||
E('ERR_HTTP2_HEADERS_OBJECT', 'Headers must be an object');
|
||||
E('ERR_HTTP2_HEADERS_SENT', 'Response has already been initiated.');
|
||||
E('ERR_HTTP2_HEADERS_AFTER_RESPOND',
|
||||
'Cannot specify additional headers after response initiated');
|
||||
E('ERR_HTTP2_HEADERS_OBJECT', 'Headers must be an object');
|
||||
E('ERR_HTTP2_HEADERS_SENT', 'Response has already been initiated.');
|
||||
E('ERR_HTTP2_INFO_HEADERS_AFTER_RESPOND',
|
||||
'Cannot send informational headers after the HTTP message has been sent');
|
||||
E('ERR_HTTP2_INFO_STATUS_NOT_ALLOWED',
|
||||
@@ -168,24 +168,24 @@ E('ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH',
|
||||
E('ERR_HTTP2_INVALID_PSEUDOHEADER',
|
||||
(name) => `"${name}" is an invalid pseudoheader or is used incorrectly`);
|
||||
E('ERR_HTTP2_INVALID_SESSION', 'The session has been destroyed');
|
||||
E('ERR_HTTP2_INVALID_STREAM', 'The stream has been destroyed');
|
||||
E('ERR_HTTP2_INVALID_SETTING_VALUE',
|
||||
(name, value) => `Invalid value for setting "${name}": ${value}`);
|
||||
E('ERR_HTTP2_INVALID_STREAM', 'The stream has been destroyed');
|
||||
E('ERR_HTTP2_MAX_PENDING_SETTINGS_ACK',
|
||||
(max) => `Maximum number of pending settings acknowledgements (${max})`);
|
||||
E('ERR_HTTP2_PAYLOAD_FORBIDDEN',
|
||||
(code) => `Responses with ${code} status must not have a payload`);
|
||||
E('ERR_HTTP2_OUT_OF_STREAMS',
|
||||
'No stream ID is available because maximum stream ID has been reached');
|
||||
E('ERR_HTTP2_PAYLOAD_FORBIDDEN',
|
||||
(code) => `Responses with ${code} status must not have a payload`);
|
||||
E('ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED', 'Cannot set HTTP/2 pseudo-headers');
|
||||
E('ERR_HTTP2_PUSH_DISABLED', 'HTTP/2 client has disabled push streams');
|
||||
E('ERR_HTTP2_SEND_FILE', 'Only regular files can be sent');
|
||||
E('ERR_HTTP2_SOCKET_BOUND',
|
||||
'The socket is already bound to an Http2Session');
|
||||
E('ERR_HTTP2_STATUS_INVALID',
|
||||
(code) => `Invalid status code: ${code}`);
|
||||
E('ERR_HTTP2_STATUS_101',
|
||||
'HTTP status code 101 (Switching Protocols) is forbidden in HTTP/2');
|
||||
E('ERR_HTTP2_STATUS_INVALID',
|
||||
(code) => `Invalid status code: ${code}`);
|
||||
E('ERR_HTTP2_STREAM_CLOSED', 'The stream is already closed');
|
||||
E('ERR_HTTP2_STREAM_ERROR',
|
||||
(code) => `Stream closed with error code ${code}`);
|
||||
@@ -234,24 +234,31 @@ E('ERR_NAPI_CONS_FUNCTION', 'Constructor must be a function');
|
||||
E('ERR_NAPI_CONS_PROTOTYPE_OBJECT', 'Constructor.prototype must be an object');
|
||||
E('ERR_NO_CRYPTO', 'Node.js is not compiled with OpenSSL crypto support');
|
||||
E('ERR_NO_ICU', '%s is not supported on Node.js compiled without ICU');
|
||||
E('ERR_OUTOFMEMORY', 'Out of memory');
|
||||
E('ERR_PARSE_HISTORY_DATA', 'Could not parse history data in %s');
|
||||
E('ERR_REQUIRE_ESM', 'Must use import to load ES Module: %s');
|
||||
E('ERR_SOCKET_ALREADY_BOUND', 'Socket is already bound');
|
||||
E('ERR_SOCKET_BAD_BUFFER_SIZE', 'Buffer size must be a positive integer');
|
||||
E('ERR_SOCKET_BAD_PORT', 'Port should be > 0 and < 65536');
|
||||
E('ERR_SOCKET_BAD_TYPE',
|
||||
'Bad socket type specified. Valid types are: udp4, udp6');
|
||||
E('ERR_SOCKET_BUFFER_SIZE',
|
||||
(reason) => `Could not get or set buffer size: ${reason}`);
|
||||
E('ERR_SOCKET_CANNOT_SEND', 'Unable to send data');
|
||||
E('ERR_SOCKET_BAD_PORT', 'Port should be > 0 and < 65536');
|
||||
E('ERR_SOCKET_DGRAM_NOT_RUNNING', 'Not running');
|
||||
E('ERR_OUTOFMEMORY', 'Out of memory');
|
||||
E('ERR_STDERR_CLOSE', 'process.stderr cannot be closed');
|
||||
E('ERR_STDOUT_CLOSE', 'process.stdout cannot be closed');
|
||||
E('ERR_UNKNOWN_BUILTIN_MODULE', (id) => `No such built-in module: ${id}`);
|
||||
E('ERR_UNKNOWN_SIGNAL', (signal) => `Unknown signal: ${signal}`);
|
||||
E('ERR_UNKNOWN_STDIN_TYPE', 'Unknown stdin file type');
|
||||
E('ERR_UNKNOWN_STREAM_TYPE', 'Unknown stream file type');
|
||||
E('ERR_V8BREAKITERATOR', 'Full ICU data not installed. ' +
|
||||
'See https://github.com/nodejs/node/wiki/Intl');
|
||||
E('ERR_VALID_PERFORMANCE_ENTRY_TYPE',
|
||||
'At least one valid performance entry type is required');
|
||||
// Add new errors from here...
|
||||
E('ERR_VALUE_OUT_OF_RANGE', (start, end, value) => {
|
||||
return `The value of "${start}" must be ${end}. Received "${value}"`;
|
||||
});
|
||||
|
||||
function invalidArgType(name, expected, actual) {
|
||||
internalAssert(name, 'name is required');
|
||||
|
||||
Reference in new issue
Block a user