Skip to content

Commit 324aa64

Browse files
maclover7refack
authored andcommitted
errors: alphabetize error codes
PR-URL: #15083 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent ec599b8 commit 324aa64

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

lib/internal/errors.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,18 @@ E('ERR_CONSOLE_WRITABLE_STREAM',
110110
E('ERR_CPU_USAGE', 'Unable to obtain cpu usage %s');
111111
E('ERR_DNS_SET_SERVERS_FAILED', (err, servers) =>
112112
`c-ares failed to set servers: "${err}" [${servers}]`);
113-
E('ERR_FALSY_VALUE_REJECTION', 'Promise was rejected with falsy value');
114-
E('ERR_ENCODING_NOT_SUPPORTED',
115-
(enc) => `The "${enc}" encoding is not supported`);
116113
E('ERR_ENCODING_INVALID_ENCODED_DATA',
117114
(enc) => `The encoded data was not valid for encoding ${enc}`);
115+
E('ERR_ENCODING_NOT_SUPPORTED',
116+
(enc) => `The "${enc}" encoding is not supported`);
117+
E('ERR_FALSY_VALUE_REJECTION', 'Promise was rejected with falsy value');
118118
E('ERR_HTTP_HEADERS_SENT',
119119
'Cannot %s headers after they are sent to the client');
120-
E('ERR_HTTP_TRAILER_INVALID',
121-
'Trailers are invalid with this transfer encoding');
122120
E('ERR_HTTP_INVALID_CHAR', 'Invalid character in statusMessage.');
123121
E('ERR_HTTP_INVALID_STATUS_CODE',
124122
(originalStatusCode) => `Invalid status code: ${originalStatusCode}`);
123+
E('ERR_HTTP_TRAILER_INVALID',
124+
'Trailers are invalid with this transfer encoding');
125125
E('ERR_HTTP2_CONNECT_AUTHORITY',
126126
':authority header is required for CONNECT requests');
127127
E('ERR_HTTP2_CONNECT_PATH',
@@ -140,10 +140,10 @@ E('ERR_HTTP2_HEADER_REQUIRED',
140140
(name) => `The ${name} header is required`);
141141
E('ERR_HTTP2_HEADER_SINGLE_VALUE',
142142
(name) => `Header field "${name}" must have only a single value`);
143-
E('ERR_HTTP2_HEADERS_OBJECT', 'Headers must be an object');
144-
E('ERR_HTTP2_HEADERS_SENT', 'Response has already been initiated.');
145143
E('ERR_HTTP2_HEADERS_AFTER_RESPOND',
146144
'Cannot specify additional headers after response initiated');
145+
E('ERR_HTTP2_HEADERS_OBJECT', 'Headers must be an object');
146+
E('ERR_HTTP2_HEADERS_SENT', 'Response has already been initiated.');
147147
E('ERR_HTTP2_INFO_HEADERS_AFTER_RESPOND',
148148
'Cannot send informational headers after the HTTP message has been sent');
149149
E('ERR_HTTP2_INFO_STATUS_NOT_ALLOWED',
@@ -158,24 +158,24 @@ E('ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH',
158158
E('ERR_HTTP2_INVALID_PSEUDOHEADER',
159159
(name) => `"${name}" is an invalid pseudoheader or is used incorrectly`);
160160
E('ERR_HTTP2_INVALID_SESSION', 'The session has been destroyed');
161-
E('ERR_HTTP2_INVALID_STREAM', 'The stream has been destroyed');
162161
E('ERR_HTTP2_INVALID_SETTING_VALUE',
163162
(name, value) => `Invalid value for setting "${name}": ${value}`);
163+
E('ERR_HTTP2_INVALID_STREAM', 'The stream has been destroyed');
164164
E('ERR_HTTP2_MAX_PENDING_SETTINGS_ACK',
165165
(max) => `Maximum number of pending settings acknowledgements (${max})`);
166-
E('ERR_HTTP2_PAYLOAD_FORBIDDEN',
167-
(code) => `Responses with ${code} status must not have a payload`);
168166
E('ERR_HTTP2_OUT_OF_STREAMS',
169167
'No stream ID is available because maximum stream ID has been reached');
168+
E('ERR_HTTP2_PAYLOAD_FORBIDDEN',
169+
(code) => `Responses with ${code} status must not have a payload`);
170170
E('ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED', 'Cannot set HTTP/2 pseudo-headers');
171171
E('ERR_HTTP2_PUSH_DISABLED', 'HTTP/2 client has disabled push streams');
172172
E('ERR_HTTP2_SEND_FILE', 'Only regular files can be sent');
173173
E('ERR_HTTP2_SOCKET_BOUND',
174174
'The socket is already bound to an Http2Session');
175-
E('ERR_HTTP2_STATUS_INVALID',
176-
(code) => `Invalid status code: ${code}`);
177175
E('ERR_HTTP2_STATUS_101',
178176
'HTTP status code 101 (Switching Protocols) is forbidden in HTTP/2');
177+
E('ERR_HTTP2_STATUS_INVALID',
178+
(code) => `Invalid status code: ${code}`);
179179
E('ERR_HTTP2_STREAM_CLOSED', 'The stream is already closed');
180180
E('ERR_HTTP2_STREAM_ERROR',
181181
(code) => `Stream closed with error code ${code}`);
@@ -209,6 +209,7 @@ E('ERR_INVALID_OPT_VALUE',
209209
});
210210
E('ERR_INVALID_OPT_VALUE_ENCODING',
211211
(value) => `The value "${String(value)}" is invalid for option "encoding"`);
212+
E('ERR_INVALID_PERFORMANCE_MARK', 'The "%s" performance mark has not been set');
212213
E('ERR_INVALID_PROTOCOL', (protocol, expectedProtocol) =>
213214
`Protocol "${protocol}" not supported. Expected "${expectedProtocol}"`);
214215
E('ERR_INVALID_REPL_EVAL_CONFIG',
@@ -232,16 +233,15 @@ E('ERR_NAPI_CONS_PROTOTYPE_OBJECT', 'Constructor.prototype must be an object');
232233
E('ERR_NO_CRYPTO', 'Node.js is not compiled with OpenSSL crypto support');
233234
E('ERR_NO_ICU', '%s is not supported on Node.js compiled without ICU');
234235
E('ERR_NO_LONGER_SUPPORTED', '%s is no longer supported');
236+
E('ERR_OUTOFMEMORY', 'Out of memory');
235237
E('ERR_PARSE_HISTORY_DATA', 'Could not parse history data in %s');
236-
E('ERR_INVALID_PERFORMANCE_MARK', 'The "%s" performance mark has not been set');
237238
E('ERR_SOCKET_ALREADY_BOUND', 'Socket is already bound');
238239
E('ERR_SOCKET_BAD_PORT', 'Port should be > 0 and < 65536');
239240
E('ERR_SOCKET_BAD_TYPE',
240241
'Bad socket type specified. Valid types are: udp4, udp6');
241242
E('ERR_SOCKET_CANNOT_SEND', 'Unable to send data');
242243
E('ERR_SOCKET_CLOSED', 'Socket is closed');
243244
E('ERR_SOCKET_DGRAM_NOT_RUNNING', 'Not running');
244-
E('ERR_OUTOFMEMORY', 'Out of memory');
245245
E('ERR_STDERR_CLOSE', 'process.stderr cannot be closed');
246246
E('ERR_STDOUT_CLOSE', 'process.stdout cannot be closed');
247247
E('ERR_STREAM_WRAP', 'Stream has StringDecoder set or is in objectMode');

0 commit comments

Comments
 (0)