Skip to content

Commit f72da3b

Browse files
maclover7MylesBorins
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 <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>
1 parent 547fe58 commit f72da3b

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

lib/internal/errors.js

Lines changed: 14 additions & 14 deletions
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

@@ -127,11 +127,11 @@ E('ERR_ENCODING_NOT_SUPPORTED',
127127
E('ERR_FALSY_VALUE_REJECTION', 'Promise was rejected with falsy value');
128128
E('ERR_HTTP_HEADERS_SENT',
129129
'Cannot render headers after they are sent to the client');
130-
E('ERR_HTTP_TRAILER_INVALID',
131-
'Trailers are invalid with this transfer encoding');
132130
E('ERR_HTTP_INVALID_CHAR', 'Invalid character in statusMessage.');
133131
E('ERR_HTTP_INVALID_STATUS_CODE',
134132
(originalStatusCode) => `Invalid status code: ${originalStatusCode}`);
133+
E('ERR_HTTP_TRAILER_INVALID',
134+
'Trailers are invalid with this transfer encoding');
135135
E('ERR_HTTP2_CONNECT_AUTHORITY',
136136
':authority header is required for CONNECT requests');
137137
E('ERR_HTTP2_CONNECT_PATH',
@@ -150,10 +150,10 @@ E('ERR_HTTP2_HEADER_REQUIRED',
150150
(name) => `The ${name} header is required`);
151151
E('ERR_HTTP2_HEADER_SINGLE_VALUE',
152152
(name) => `Header field "${name}" must have only a single value`);
153-
E('ERR_HTTP2_HEADERS_OBJECT', 'Headers must be an object');
154-
E('ERR_HTTP2_HEADERS_SENT', 'Response has already been initiated.');
155153
E('ERR_HTTP2_HEADERS_AFTER_RESPOND',
156154
'Cannot specify additional headers after response initiated');
155+
E('ERR_HTTP2_HEADERS_OBJECT', 'Headers must be an object');
156+
E('ERR_HTTP2_HEADERS_SENT', 'Response has already been initiated.');
157157
E('ERR_HTTP2_INFO_HEADERS_AFTER_RESPOND',
158158
'Cannot send informational headers after the HTTP message has been sent');
159159
E('ERR_HTTP2_INFO_STATUS_NOT_ALLOWED',
@@ -168,24 +168,24 @@ E('ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH',
168168
E('ERR_HTTP2_INVALID_PSEUDOHEADER',
169169
(name) => `"${name}" is an invalid pseudoheader or is used incorrectly`);
170170
E('ERR_HTTP2_INVALID_SESSION', 'The session has been destroyed');
171-
E('ERR_HTTP2_INVALID_STREAM', 'The stream has been destroyed');
172171
E('ERR_HTTP2_INVALID_SETTING_VALUE',
173172
(name, value) => `Invalid value for setting "${name}": ${value}`);
173+
E('ERR_HTTP2_INVALID_STREAM', 'The stream has been destroyed');
174174
E('ERR_HTTP2_MAX_PENDING_SETTINGS_ACK',
175175
(max) => `Maximum number of pending settings acknowledgements (${max})`);
176-
E('ERR_HTTP2_PAYLOAD_FORBIDDEN',
177-
(code) => `Responses with ${code} status must not have a payload`);
178176
E('ERR_HTTP2_OUT_OF_STREAMS',
179177
'No stream ID is available because maximum stream ID has been reached');
178+
E('ERR_HTTP2_PAYLOAD_FORBIDDEN',
179+
(code) => `Responses with ${code} status must not have a payload`);
180180
E('ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED', 'Cannot set HTTP/2 pseudo-headers');
181181
E('ERR_HTTP2_PUSH_DISABLED', 'HTTP/2 client has disabled push streams');
182182
E('ERR_HTTP2_SEND_FILE', 'Only regular files can be sent');
183183
E('ERR_HTTP2_SOCKET_BOUND',
184184
'The socket is already bound to an Http2Session');
185-
E('ERR_HTTP2_STATUS_INVALID',
186-
(code) => `Invalid status code: ${code}`);
187185
E('ERR_HTTP2_STATUS_101',
188186
'HTTP status code 101 (Switching Protocols) is forbidden in HTTP/2');
187+
E('ERR_HTTP2_STATUS_INVALID',
188+
(code) => `Invalid status code: ${code}`);
189189
E('ERR_HTTP2_STREAM_CLOSED', 'The stream is already closed');
190190
E('ERR_HTTP2_STREAM_ERROR',
191191
(code) => `Stream closed with error code ${code}`);
@@ -235,18 +235,18 @@ E('ERR_NAPI_CONS_FUNCTION', 'Constructor must be a function');
235235
E('ERR_NAPI_CONS_PROTOTYPE_OBJECT', 'Constructor.prototype must be an object');
236236
E('ERR_NO_CRYPTO', 'Node.js is not compiled with OpenSSL crypto support');
237237
E('ERR_NO_ICU', '%s is not supported on Node.js compiled without ICU');
238+
E('ERR_OUTOFMEMORY', 'Out of memory');
238239
E('ERR_PARSE_HISTORY_DATA', 'Could not parse history data in %s');
239240
E('ERR_REQUIRE_ESM', 'Must use import to load ES Module: %s');
240241
E('ERR_SOCKET_ALREADY_BOUND', 'Socket is already bound');
242+
E('ERR_SOCKET_BAD_BUFFER_SIZE', 'Buffer size must be a positive integer');
243+
E('ERR_SOCKET_BAD_PORT', 'Port should be > 0 and < 65536');
241244
E('ERR_SOCKET_BAD_TYPE',
242245
'Bad socket type specified. Valid types are: udp4, udp6');
243-
E('ERR_SOCKET_CANNOT_SEND', 'Unable to send data');
244-
E('ERR_SOCKET_BAD_PORT', 'Port should be > 0 and < 65536');
245-
E('ERR_SOCKET_BAD_BUFFER_SIZE', 'Buffer size must be a positive integer');
246246
E('ERR_SOCKET_BUFFER_SIZE',
247247
(reason) => `Could not get or set buffer size: ${reason}`);
248+
E('ERR_SOCKET_CANNOT_SEND', 'Unable to send data');
248249
E('ERR_SOCKET_DGRAM_NOT_RUNNING', 'Not running');
249-
E('ERR_OUTOFMEMORY', 'Out of memory');
250250
E('ERR_STDERR_CLOSE', 'process.stderr cannot be closed');
251251
E('ERR_STDOUT_CLOSE', 'process.stdout cannot be closed');
252252
E('ERR_UNKNOWN_BUILTIN_MODULE', (id) => `No such built-in module: ${id}`);

0 commit comments

Comments
 (0)