xref: /aosp_15_r20/external/cronet/net/base/net_error_list.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2012 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // This file intentionally does not have header guards, it's included
6 // inside a macro to generate enum values. The following line silences a
7 // presubmit and Tricium warning that would otherwise be triggered by this:
8 // no-include-guard-because-multiply-included
9 // NOLINT(build/header_guard)
10 
11 // This file contains the list of network errors.
12 
13 //
14 // Ranges:
15 //     0- 99 System related errors
16 //   100-199 Connection related errors
17 //   200-299 Certificate errors
18 //   300-399 HTTP errors
19 //   400-499 Cache errors
20 //   500-599 ?
21 //   600-699 <Obsolete: FTP errors>
22 //   700-799 Certificate manager errors
23 //   800-899 DNS resolver errors
24 
25 // An asynchronous IO operation is not yet complete.  This usually does not
26 // indicate a fatal error.  Typically this error will be generated as a
27 // notification to wait for some external notification that the IO operation
28 // finally completed.
29 NET_ERROR(IO_PENDING, -1)
30 
31 // A generic failure occurred.
32 NET_ERROR(FAILED, -2)
33 
34 // An operation was aborted (due to user action).
35 NET_ERROR(ABORTED, -3)
36 
37 // An argument to the function is incorrect.
38 NET_ERROR(INVALID_ARGUMENT, -4)
39 
40 // The handle or file descriptor is invalid.
41 NET_ERROR(INVALID_HANDLE, -5)
42 
43 // The file or directory cannot be found.
44 NET_ERROR(FILE_NOT_FOUND, -6)
45 
46 // An operation timed out.
47 NET_ERROR(TIMED_OUT, -7)
48 
49 // The file is too large.
50 NET_ERROR(FILE_TOO_BIG, -8)
51 
52 // An unexpected error.  This may be caused by a programming mistake or an
53 // invalid assumption.
54 NET_ERROR(UNEXPECTED, -9)
55 
56 // Permission to access a resource, other than the network, was denied.
57 NET_ERROR(ACCESS_DENIED, -10)
58 
59 // The operation failed because of unimplemented functionality.
60 NET_ERROR(NOT_IMPLEMENTED, -11)
61 
62 // There were not enough resources to complete the operation.
63 NET_ERROR(INSUFFICIENT_RESOURCES, -12)
64 
65 // Memory allocation failed.
66 NET_ERROR(OUT_OF_MEMORY, -13)
67 
68 // The file upload failed because the file's modification time was different
69 // from the expectation.
70 NET_ERROR(UPLOAD_FILE_CHANGED, -14)
71 
72 // The socket is not connected.
73 NET_ERROR(SOCKET_NOT_CONNECTED, -15)
74 
75 // The file already exists.
76 NET_ERROR(FILE_EXISTS, -16)
77 
78 // The path or file name is too long.
79 NET_ERROR(FILE_PATH_TOO_LONG, -17)
80 
81 // Not enough room left on the disk.
82 NET_ERROR(FILE_NO_SPACE, -18)
83 
84 // The file has a virus.
85 NET_ERROR(FILE_VIRUS_INFECTED, -19)
86 
87 // The client chose to block the request.
88 NET_ERROR(BLOCKED_BY_CLIENT, -20)
89 
90 // The network changed.
91 NET_ERROR(NETWORK_CHANGED, -21)
92 
93 // The request was blocked by the URL block list configured by the domain
94 // administrator.
95 NET_ERROR(BLOCKED_BY_ADMINISTRATOR, -22)
96 
97 // The socket is already connected.
98 NET_ERROR(SOCKET_IS_CONNECTED, -23)
99 
100 // Error -24 was removed (BLOCKED_ENROLLMENT_CHECK_PENDING)
101 
102 // The upload failed because the upload stream needed to be re-read, due to a
103 // retry or a redirect, but the upload stream doesn't support that operation.
104 NET_ERROR(UPLOAD_STREAM_REWIND_NOT_SUPPORTED, -25)
105 
106 // The request failed because the URLRequestContext is shutting down, or has
107 // been shut down.
108 NET_ERROR(CONTEXT_SHUT_DOWN, -26)
109 
110 // The request failed because the response was delivered along with requirements
111 // which are not met ('X-Frame-Options' and 'Content-Security-Policy' ancestor
112 // checks and 'Cross-Origin-Resource-Policy' for instance).
113 NET_ERROR(BLOCKED_BY_RESPONSE, -27)
114 
115 // Error -28 was removed (BLOCKED_BY_XSS_AUDITOR).
116 
117 // The request was blocked by system policy disallowing some or all cleartext
118 // requests. Used for NetworkSecurityPolicy on Android.
119 NET_ERROR(CLEARTEXT_NOT_PERMITTED, -29)
120 
121 // The request was blocked by a Content Security Policy
122 NET_ERROR(BLOCKED_BY_CSP, -30)
123 
124 // The request was blocked because of no H/2 or QUIC session.
125 NET_ERROR(H2_OR_QUIC_REQUIRED, -31)
126 
127 // The request was blocked by CORB or ORB.
128 NET_ERROR(BLOCKED_BY_ORB, -32)
129 
130 // The request was blocked because it originated from a frame that has disabled
131 // network access.
132 NET_ERROR(NETWORK_ACCESS_REVOKED, -33)
133 
134 // A connection was closed (corresponding to a TCP FIN).
135 NET_ERROR(CONNECTION_CLOSED, -100)
136 
137 // A connection was reset (corresponding to a TCP RST).
138 NET_ERROR(CONNECTION_RESET, -101)
139 
140 // A connection attempt was refused.
141 NET_ERROR(CONNECTION_REFUSED, -102)
142 
143 // A connection timed out as a result of not receiving an ACK for data sent.
144 // This can include a FIN packet that did not get ACK'd.
145 NET_ERROR(CONNECTION_ABORTED, -103)
146 
147 // A connection attempt failed.
148 NET_ERROR(CONNECTION_FAILED, -104)
149 
150 // The host name could not be resolved.
151 NET_ERROR(NAME_NOT_RESOLVED, -105)
152 
153 // The Internet connection has been lost.
154 NET_ERROR(INTERNET_DISCONNECTED, -106)
155 
156 // An SSL protocol error occurred.
157 NET_ERROR(SSL_PROTOCOL_ERROR, -107)
158 
159 // The IP address or port number is invalid (e.g., cannot connect to the IP
160 // address 0 or the port 0).
161 NET_ERROR(ADDRESS_INVALID, -108)
162 
163 // The IP address is unreachable.  This usually means that there is no route to
164 // the specified host or network.
165 NET_ERROR(ADDRESS_UNREACHABLE, -109)
166 
167 // The server requested a client certificate for SSL client authentication.
168 NET_ERROR(SSL_CLIENT_AUTH_CERT_NEEDED, -110)
169 
170 // A tunnel connection through the proxy could not be established.
171 NET_ERROR(TUNNEL_CONNECTION_FAILED, -111)
172 
173 // No SSL protocol versions are enabled.
174 NET_ERROR(NO_SSL_VERSIONS_ENABLED, -112)
175 
176 // The client and server don't support a common SSL protocol version or
177 // cipher suite.
178 NET_ERROR(SSL_VERSION_OR_CIPHER_MISMATCH, -113)
179 
180 // The server requested a renegotiation (rehandshake).
181 NET_ERROR(SSL_RENEGOTIATION_REQUESTED, -114)
182 
183 // The proxy requested authentication (for tunnel establishment) with an
184 // unsupported method.
185 NET_ERROR(PROXY_AUTH_UNSUPPORTED, -115)
186 
187 // Error -116 was removed (CERT_ERROR_IN_SSL_RENEGOTIATION)
188 
189 // The SSL handshake failed because of a bad or missing client certificate.
190 NET_ERROR(BAD_SSL_CLIENT_AUTH_CERT, -117)
191 
192 // A connection attempt timed out.
193 NET_ERROR(CONNECTION_TIMED_OUT, -118)
194 
195 // There are too many pending DNS resolves, so a request in the queue was
196 // aborted.
197 NET_ERROR(HOST_RESOLVER_QUEUE_TOO_LARGE, -119)
198 
199 // Failed establishing a connection to the SOCKS proxy server for a target host.
200 NET_ERROR(SOCKS_CONNECTION_FAILED, -120)
201 
202 // The SOCKS proxy server failed establishing connection to the target host
203 // because that host is unreachable.
204 NET_ERROR(SOCKS_CONNECTION_HOST_UNREACHABLE, -121)
205 
206 // The request to negotiate an alternate protocol failed.
207 NET_ERROR(ALPN_NEGOTIATION_FAILED, -122)
208 
209 // The peer sent an SSL no_renegotiation alert message.
210 NET_ERROR(SSL_NO_RENEGOTIATION, -123)
211 
212 // Winsock sometimes reports more data written than passed.  This is probably
213 // due to a broken LSP.
214 NET_ERROR(WINSOCK_UNEXPECTED_WRITTEN_BYTES, -124)
215 
216 // An SSL peer sent us a fatal decompression_failure alert. This typically
217 // occurs when a peer selects DEFLATE compression in the mistaken belief that
218 // it supports it.
219 NET_ERROR(SSL_DECOMPRESSION_FAILURE_ALERT, -125)
220 
221 // An SSL peer sent us a fatal bad_record_mac alert. This has been observed
222 // from servers with buggy DEFLATE support.
223 NET_ERROR(SSL_BAD_RECORD_MAC_ALERT, -126)
224 
225 // The proxy requested authentication (for tunnel establishment).
226 NET_ERROR(PROXY_AUTH_REQUESTED, -127)
227 
228 // Error -129 was removed (SSL_WEAK_SERVER_EPHEMERAL_DH_KEY).
229 
230 // Could not create a connection to the proxy server. An error occurred
231 // either in resolving its name, or in connecting a socket to it.
232 // Note that this does NOT include failures during the actual "CONNECT" method
233 // of an HTTP proxy.
234 NET_ERROR(PROXY_CONNECTION_FAILED, -130)
235 
236 // A mandatory proxy configuration could not be used. Currently this means
237 // that a mandatory PAC script could not be fetched, parsed or executed.
238 NET_ERROR(MANDATORY_PROXY_CONFIGURATION_FAILED, -131)
239 
240 // -132 was formerly ERR_ESET_ANTI_VIRUS_SSL_INTERCEPTION
241 
242 // We've hit the max socket limit for the socket pool while preconnecting.  We
243 // don't bother trying to preconnect more sockets.
244 NET_ERROR(PRECONNECT_MAX_SOCKET_LIMIT, -133)
245 
246 // The permission to use the SSL client certificate's private key was denied.
247 NET_ERROR(SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED, -134)
248 
249 // The SSL client certificate has no private key.
250 NET_ERROR(SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY, -135)
251 
252 // The certificate presented by the HTTPS Proxy was invalid.
253 NET_ERROR(PROXY_CERTIFICATE_INVALID, -136)
254 
255 // An error occurred when trying to do a name resolution (DNS).
256 NET_ERROR(NAME_RESOLUTION_FAILED, -137)
257 
258 // Permission to access the network was denied. This is used to distinguish
259 // errors that were most likely caused by a firewall from other access denied
260 // errors. See also ERR_ACCESS_DENIED.
261 NET_ERROR(NETWORK_ACCESS_DENIED, -138)
262 
263 // The request throttler module cancelled this request to avoid DDOS.
264 NET_ERROR(TEMPORARILY_THROTTLED, -139)
265 
266 // A request to create an SSL tunnel connection through the HTTPS proxy
267 // received a 302 (temporary redirect) response.  The response body might
268 // include a description of why the request failed.
269 //
270 // TODO(https://crbug.com/928551): This is deprecated and should not be used by
271 // new code.
272 NET_ERROR(HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT, -140)
273 
274 // We were unable to sign the CertificateVerify data of an SSL client auth
275 // handshake with the client certificate's private key.
276 //
277 // Possible causes for this include the user implicitly or explicitly
278 // denying access to the private key, the private key may not be valid for
279 // signing, the key may be relying on a cached handle which is no longer
280 // valid, or the CSP won't allow arbitrary data to be signed.
281 NET_ERROR(SSL_CLIENT_AUTH_SIGNATURE_FAILED, -141)
282 
283 // The message was too large for the transport.  (for example a UDP message
284 // which exceeds size threshold).
285 NET_ERROR(MSG_TOO_BIG, -142)
286 
287 // Error -143 was removed (SPDY_SESSION_ALREADY_EXISTS)
288 
289 // Error -144 was removed (LIMIT_VIOLATION).
290 
291 // Websocket protocol error. Indicates that we are terminating the connection
292 // due to a malformed frame or other protocol violation.
293 NET_ERROR(WS_PROTOCOL_ERROR, -145)
294 
295 // Error -146 was removed (PROTOCOL_SWITCHED)
296 
297 // Returned when attempting to bind an address that is already in use.
298 NET_ERROR(ADDRESS_IN_USE, -147)
299 
300 // An operation failed because the SSL handshake has not completed.
301 NET_ERROR(SSL_HANDSHAKE_NOT_COMPLETED, -148)
302 
303 // SSL peer's public key is invalid.
304 NET_ERROR(SSL_BAD_PEER_PUBLIC_KEY, -149)
305 
306 // The certificate didn't match the built-in public key pins for the host name.
307 // The pins are set in net/http/transport_security_state.cc and require that
308 // one of a set of public keys exist on the path from the leaf to the root.
309 NET_ERROR(SSL_PINNED_KEY_NOT_IN_CERT_CHAIN, -150)
310 
311 // Server request for client certificate did not contain any types we support.
312 NET_ERROR(CLIENT_AUTH_CERT_TYPE_UNSUPPORTED, -151)
313 
314 // Error -152 was removed (ORIGIN_BOUND_CERT_GENERATION_TYPE_MISMATCH)
315 
316 // An SSL peer sent us a fatal decrypt_error alert. This typically occurs when
317 // a peer could not correctly verify a signature (in CertificateVerify or
318 // ServerKeyExchange) or validate a Finished message.
319 NET_ERROR(SSL_DECRYPT_ERROR_ALERT, -153)
320 
321 // There are too many pending WebSocketJob instances, so the new job was not
322 // pushed to the queue.
323 NET_ERROR(WS_THROTTLE_QUEUE_TOO_LARGE, -154)
324 
325 // Error -155 was removed (TOO_MANY_SOCKET_STREAMS)
326 
327 // The SSL server certificate changed in a renegotiation.
328 NET_ERROR(SSL_SERVER_CERT_CHANGED, -156)
329 
330 // Error -157 was removed (SSL_INAPPROPRIATE_FALLBACK).
331 
332 // Error -158 was removed (CT_NO_SCTS_VERIFIED_OK).
333 
334 // The SSL server sent us a fatal unrecognized_name alert.
335 NET_ERROR(SSL_UNRECOGNIZED_NAME_ALERT, -159)
336 
337 // Failed to set the socket's receive buffer size as requested.
338 NET_ERROR(SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR, -160)
339 
340 // Failed to set the socket's send buffer size as requested.
341 NET_ERROR(SOCKET_SET_SEND_BUFFER_SIZE_ERROR, -161)
342 
343 // Failed to set the socket's receive buffer size as requested, despite success
344 // return code from setsockopt.
345 NET_ERROR(SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE, -162)
346 
347 // Failed to set the socket's send buffer size as requested, despite success
348 // return code from setsockopt.
349 NET_ERROR(SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE, -163)
350 
351 // Failed to import a client certificate from the platform store into the SSL
352 // library.
353 NET_ERROR(SSL_CLIENT_AUTH_CERT_BAD_FORMAT, -164)
354 
355 // Error -165 was removed (SSL_FALLBACK_BEYOND_MINIMUM_VERSION).
356 
357 // Resolving a hostname to an IP address list included the IPv4 address
358 // "127.0.53.53". This is a special IP address which ICANN has recommended to
359 // indicate there was a name collision, and alert admins to a potential
360 // problem.
361 NET_ERROR(ICANN_NAME_COLLISION, -166)
362 
363 // The SSL server presented a certificate which could not be decoded. This is
364 // not a certificate error code as no X509Certificate object is available. This
365 // error is fatal.
366 NET_ERROR(SSL_SERVER_CERT_BAD_FORMAT, -167)
367 
368 // Certificate Transparency: Received a signed tree head that failed to parse.
369 NET_ERROR(CT_STH_PARSING_FAILED, -168)
370 
371 // Certificate Transparency: Received a signed tree head whose JSON parsing was
372 // OK but was missing some of the fields.
373 NET_ERROR(CT_STH_INCOMPLETE, -169)
374 
375 // The attempt to reuse a connection to send proxy auth credentials failed
376 // before the AuthController was used to generate credentials. The caller should
377 // reuse the controller with a new connection. This error is only used
378 // internally by the network stack.
379 NET_ERROR(UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH, -170)
380 
381 // Certificate Transparency: Failed to parse the received consistency proof.
382 NET_ERROR(CT_CONSISTENCY_PROOF_PARSING_FAILED, -171)
383 
384 // The SSL server required an unsupported cipher suite that has since been
385 // removed. This error will temporarily be signaled on a fallback for one or two
386 // releases immediately following a cipher suite's removal, after which the
387 // fallback will be removed.
388 NET_ERROR(SSL_OBSOLETE_CIPHER, -172)
389 
390 // When a WebSocket handshake is done successfully and the connection has been
391 // upgraded, the URLRequest is cancelled with this error code.
392 NET_ERROR(WS_UPGRADE, -173)
393 
394 // Socket ReadIfReady support is not implemented. This error should not be user
395 // visible, because the normal Read() method is used as a fallback.
396 NET_ERROR(READ_IF_READY_NOT_IMPLEMENTED, -174)
397 
398 // Error -175 was removed (SSL_VERSION_INTERFERENCE).
399 
400 // No socket buffer space is available.
401 NET_ERROR(NO_BUFFER_SPACE, -176)
402 
403 // There were no common signature algorithms between our client certificate
404 // private key and the server's preferences.
405 NET_ERROR(SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS, -177)
406 
407 // TLS 1.3 early data was rejected by the server. This will be received before
408 // any data is returned from the socket. The request should be retried with
409 // early data disabled.
410 NET_ERROR(EARLY_DATA_REJECTED, -178)
411 
412 // TLS 1.3 early data was offered, but the server responded with TLS 1.2 or
413 // earlier. This is an internal error code to account for a
414 // backwards-compatibility issue with early data and TLS 1.2. It will be
415 // received before any data is returned from the socket. The request should be
416 // retried with early data disabled.
417 //
418 // See https://tools.ietf.org/html/rfc8446#appendix-D.3 for details.
419 NET_ERROR(WRONG_VERSION_ON_EARLY_DATA, -179)
420 
421 // TLS 1.3 was enabled, but a lower version was negotiated and the server
422 // returned a value indicating it supported TLS 1.3. This is part of a security
423 // check in TLS 1.3, but it may also indicate the user is behind a buggy
424 // TLS-terminating proxy which implemented TLS 1.2 incorrectly. (See
425 // https://crbug.com/boringssl/226.)
426 NET_ERROR(TLS13_DOWNGRADE_DETECTED, -180)
427 
428 // The server's certificate has a keyUsage extension incompatible with the
429 // negotiated TLS key exchange method.
430 NET_ERROR(SSL_KEY_USAGE_INCOMPATIBLE, -181)
431 
432 // The ECHConfigList fetched over DNS cannot be parsed.
433 NET_ERROR(INVALID_ECH_CONFIG_LIST, -182)
434 
435 // ECH was enabled, but the server was unable to decrypt the encrypted
436 // ClientHello.
437 NET_ERROR(ECH_NOT_NEGOTIATED, -183)
438 
439 // ECH was enabled, the server was unable to decrypt the encrypted ClientHello,
440 // and additionally did not present a certificate valid for the public name.
441 NET_ERROR(ECH_FALLBACK_CERTIFICATE_INVALID, -184)
442 
443 // Certificate error codes
444 //
445 // The values of certificate error codes must be consecutive.
446 
447 // The server responded with a certificate whose common name did not match
448 // the host name.  This could mean:
449 //
450 // 1. An attacker has redirected our traffic to their server and is
451 //    presenting a certificate for which they know the private key.
452 //
453 // 2. The server is misconfigured and responding with the wrong cert.
454 //
455 // 3. The user is on a wireless network and is being redirected to the
456 //    network's login page.
457 //
458 // 4. The OS has used a DNS search suffix and the server doesn't have
459 //    a certificate for the abbreviated name in the address bar.
460 //
461 NET_ERROR(CERT_COMMON_NAME_INVALID, -200)
462 
463 // The server responded with a certificate that, by our clock, appears to
464 // either not yet be valid or to have expired.  This could mean:
465 //
466 // 1. An attacker is presenting an old certificate for which they have
467 //    managed to obtain the private key.
468 //
469 // 2. The server is misconfigured and is not presenting a valid cert.
470 //
471 // 3. Our clock is wrong.
472 //
473 NET_ERROR(CERT_DATE_INVALID, -201)
474 
475 // The server responded with a certificate that is signed by an authority
476 // we don't trust.  The could mean:
477 //
478 // 1. An attacker has substituted the real certificate for a cert that
479 //    contains their public key and is signed by their cousin.
480 //
481 // 2. The server operator has a legitimate certificate from a CA we don't
482 //    know about, but should trust.
483 //
484 // 3. The server is presenting a self-signed certificate, providing no
485 //    defense against active attackers (but foiling passive attackers).
486 //
487 NET_ERROR(CERT_AUTHORITY_INVALID, -202)
488 
489 // The server responded with a certificate that contains errors.
490 // This error is not recoverable.
491 //
492 // MSDN describes this error as follows:
493 //   "The SSL certificate contains errors."
494 // NOTE: It's unclear how this differs from ERR_CERT_INVALID. For consistency,
495 // use that code instead of this one from now on.
496 //
497 NET_ERROR(CERT_CONTAINS_ERRORS, -203)
498 
499 // The certificate has no mechanism for determining if it is revoked.  In
500 // effect, this certificate cannot be revoked.
501 NET_ERROR(CERT_NO_REVOCATION_MECHANISM, -204)
502 
503 // Revocation information for the security certificate for this site is not
504 // available.  This could mean:
505 //
506 // 1. An attacker has compromised the private key in the certificate and is
507 //    blocking our attempt to find out that the cert was revoked.
508 //
509 // 2. The certificate is unrevoked, but the revocation server is busy or
510 //    unavailable.
511 //
512 NET_ERROR(CERT_UNABLE_TO_CHECK_REVOCATION, -205)
513 
514 // The server responded with a certificate has been revoked.
515 // We have the capability to ignore this error, but it is probably not the
516 // thing to do.
517 NET_ERROR(CERT_REVOKED, -206)
518 
519 // The server responded with a certificate that is invalid.
520 // This error is not recoverable.
521 //
522 // MSDN describes this error as follows:
523 //   "The SSL certificate is invalid."
524 //
525 NET_ERROR(CERT_INVALID, -207)
526 
527 // The server responded with a certificate that is signed using a weak
528 // signature algorithm.
529 NET_ERROR(CERT_WEAK_SIGNATURE_ALGORITHM, -208)
530 
531 // -209 is available: was CERT_NOT_IN_DNS.
532 
533 // The host name specified in the certificate is not unique.
534 NET_ERROR(CERT_NON_UNIQUE_NAME, -210)
535 
536 // The server responded with a certificate that contains a weak key (e.g.
537 // a too-small RSA key).
538 NET_ERROR(CERT_WEAK_KEY, -211)
539 
540 // The certificate claimed DNS names that are in violation of name constraints.
541 NET_ERROR(CERT_NAME_CONSTRAINT_VIOLATION, -212)
542 
543 // The certificate's validity period is too long.
544 NET_ERROR(CERT_VALIDITY_TOO_LONG, -213)
545 
546 // Certificate Transparency was required for this connection, but the server
547 // did not provide CT information that complied with the policy.
548 NET_ERROR(CERTIFICATE_TRANSPARENCY_REQUIRED, -214)
549 
550 // The certificate chained to a legacy Symantec root that is no longer trusted.
551 // https://g.co/chrome/symantecpkicerts
552 NET_ERROR(CERT_SYMANTEC_LEGACY, -215)
553 
554 // -216 was QUIC_CERT_ROOT_NOT_KNOWN which has been renumbered to not be in the
555 // certificate error range.
556 
557 // The certificate is known to be used for interception by an entity other
558 // the device owner.
559 NET_ERROR(CERT_KNOWN_INTERCEPTION_BLOCKED, -217)
560 
561 // -218 was SSL_OBSOLETE_VERSION which is not longer used. TLS 1.0/1.1 instead
562 // cause SSL_VERSION_OR_CIPHER_MISMATCH now.
563 
564 // Add new certificate error codes here.
565 //
566 // Update the value of CERT_END whenever you add a new certificate error
567 // code.
568 
569 // The value immediately past the last certificate error code.
570 NET_ERROR(CERT_END, -219)
571 
572 // The URL is invalid.
573 NET_ERROR(INVALID_URL, -300)
574 
575 // The scheme of the URL is disallowed.
576 NET_ERROR(DISALLOWED_URL_SCHEME, -301)
577 
578 // The scheme of the URL is unknown.
579 NET_ERROR(UNKNOWN_URL_SCHEME, -302)
580 
581 // Attempting to load an URL resulted in a redirect to an invalid URL.
582 NET_ERROR(INVALID_REDIRECT, -303)
583 
584 // Attempting to load an URL resulted in too many redirects.
585 NET_ERROR(TOO_MANY_REDIRECTS, -310)
586 
587 // Attempting to load an URL resulted in an unsafe redirect (e.g., a redirect
588 // to file:// is considered unsafe).
589 NET_ERROR(UNSAFE_REDIRECT, -311)
590 
591 // Attempting to load an URL with an unsafe port number.  These are port
592 // numbers that correspond to services, which are not robust to spurious input
593 // that may be constructed as a result of an allowed web construct (e.g., HTTP
594 // looks a lot like SMTP, so form submission to port 25 is denied).
595 NET_ERROR(UNSAFE_PORT, -312)
596 
597 // The server's response was invalid.
598 NET_ERROR(INVALID_RESPONSE, -320)
599 
600 // Error in chunked transfer encoding.
601 NET_ERROR(INVALID_CHUNKED_ENCODING, -321)
602 
603 // The server did not support the request method.
604 NET_ERROR(METHOD_NOT_SUPPORTED, -322)
605 
606 // The response was 407 (Proxy Authentication Required), yet we did not send
607 // the request to a proxy.
608 NET_ERROR(UNEXPECTED_PROXY_AUTH, -323)
609 
610 // The server closed the connection without sending any data.
611 NET_ERROR(EMPTY_RESPONSE, -324)
612 
613 // The headers section of the response is too large.
614 NET_ERROR(RESPONSE_HEADERS_TOO_BIG, -325)
615 
616 // Error -326 was removed (PAC_STATUS_NOT_OK)
617 
618 // The evaluation of the PAC script failed.
619 NET_ERROR(PAC_SCRIPT_FAILED, -327)
620 
621 // The response was 416 (Requested range not satisfiable) and the server cannot
622 // satisfy the range requested.
623 NET_ERROR(REQUEST_RANGE_NOT_SATISFIABLE, -328)
624 
625 // The identity used for authentication is invalid.
626 NET_ERROR(MALFORMED_IDENTITY, -329)
627 
628 // Content decoding of the response body failed.
629 NET_ERROR(CONTENT_DECODING_FAILED, -330)
630 
631 // An operation could not be completed because all network IO
632 // is suspended.
633 NET_ERROR(NETWORK_IO_SUSPENDED, -331)
634 
635 // FLIP data received without receiving a SYN_REPLY on the stream.
636 NET_ERROR(SYN_REPLY_NOT_RECEIVED, -332)
637 
638 // Converting the response to target encoding failed.
639 NET_ERROR(ENCODING_CONVERSION_FAILED, -333)
640 
641 // The server sent an FTP directory listing in a format we do not understand.
642 NET_ERROR(UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT, -334)
643 
644 // Obsolete.  Was only logged in NetLog when an HTTP/2 pushed stream expired.
645 // NET_ERROR(INVALID_SPDY_STREAM, -335)
646 
647 // There are no supported proxies in the provided list.
648 NET_ERROR(NO_SUPPORTED_PROXIES, -336)
649 
650 // There is an HTTP/2 protocol error.
651 NET_ERROR(HTTP2_PROTOCOL_ERROR, -337)
652 
653 // Credentials could not be established during HTTP Authentication.
654 NET_ERROR(INVALID_AUTH_CREDENTIALS, -338)
655 
656 // An HTTP Authentication scheme was tried which is not supported on this
657 // machine.
658 NET_ERROR(UNSUPPORTED_AUTH_SCHEME, -339)
659 
660 // Detecting the encoding of the response failed.
661 NET_ERROR(ENCODING_DETECTION_FAILED, -340)
662 
663 // (GSSAPI) No Kerberos credentials were available during HTTP Authentication.
664 NET_ERROR(MISSING_AUTH_CREDENTIALS, -341)
665 
666 // An unexpected, but documented, SSPI or GSSAPI status code was returned.
667 NET_ERROR(UNEXPECTED_SECURITY_LIBRARY_STATUS, -342)
668 
669 // The environment was not set up correctly for authentication (for
670 // example, no KDC could be found or the principal is unknown.
671 NET_ERROR(MISCONFIGURED_AUTH_ENVIRONMENT, -343)
672 
673 // An undocumented SSPI or GSSAPI status code was returned.
674 NET_ERROR(UNDOCUMENTED_SECURITY_LIBRARY_STATUS, -344)
675 
676 // The HTTP response was too big to drain.
677 NET_ERROR(RESPONSE_BODY_TOO_BIG_TO_DRAIN, -345)
678 
679 // The HTTP response contained multiple distinct Content-Length headers.
680 NET_ERROR(RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH, -346)
681 
682 // HTTP/2 headers have been received, but not all of them - status or version
683 // headers are missing, so we're expecting additional frames to complete them.
684 NET_ERROR(INCOMPLETE_HTTP2_HEADERS, -347)
685 
686 // No PAC URL configuration could be retrieved from DHCP. This can indicate
687 // either a failure to retrieve the DHCP configuration, or that there was no
688 // PAC URL configured in DHCP.
689 NET_ERROR(PAC_NOT_IN_DHCP, -348)
690 
691 // The HTTP response contained multiple Content-Disposition headers.
692 NET_ERROR(RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION, -349)
693 
694 // The HTTP response contained multiple Location headers.
695 NET_ERROR(RESPONSE_HEADERS_MULTIPLE_LOCATION, -350)
696 
697 // HTTP/2 server refused the request without processing, and sent either a
698 // GOAWAY frame with error code NO_ERROR and Last-Stream-ID lower than the
699 // stream id corresponding to the request indicating that this request has not
700 // been processed yet, or a RST_STREAM frame with error code REFUSED_STREAM.
701 // Client MAY retry (on a different connection).  See RFC7540 Section 8.1.4.
702 NET_ERROR(HTTP2_SERVER_REFUSED_STREAM, -351)
703 
704 // HTTP/2 server didn't respond to the PING message.
705 NET_ERROR(HTTP2_PING_FAILED, -352)
706 
707 // Obsolete.  Kept here to avoid reuse, as the old error can still appear on
708 // histograms.
709 // NET_ERROR(PIPELINE_EVICTION, -353)
710 
711 // The HTTP response body transferred fewer bytes than were advertised by the
712 // Content-Length header when the connection is closed.
713 NET_ERROR(CONTENT_LENGTH_MISMATCH, -354)
714 
715 // The HTTP response body is transferred with Chunked-Encoding, but the
716 // terminating zero-length chunk was never sent when the connection is closed.
717 NET_ERROR(INCOMPLETE_CHUNKED_ENCODING, -355)
718 
719 // There is a QUIC protocol error.
720 NET_ERROR(QUIC_PROTOCOL_ERROR, -356)
721 
722 // The HTTP headers were truncated by an EOF.
723 NET_ERROR(RESPONSE_HEADERS_TRUNCATED, -357)
724 
725 // The QUIC crypto handshake failed.  This means that the server was unable
726 // to read any requests sent, so they may be resent.
727 NET_ERROR(QUIC_HANDSHAKE_FAILED, -358)
728 
729 // Obsolete.  Kept here to avoid reuse, as the old error can still appear on
730 // histograms.
731 // NET_ERROR(REQUEST_FOR_SECURE_RESOURCE_OVER_INSECURE_QUIC, -359)
732 
733 // Transport security is inadequate for the HTTP/2 version.
734 NET_ERROR(HTTP2_INADEQUATE_TRANSPORT_SECURITY, -360)
735 
736 // The peer violated HTTP/2 flow control.
737 NET_ERROR(HTTP2_FLOW_CONTROL_ERROR, -361)
738 
739 // The peer sent an improperly sized HTTP/2 frame.
740 NET_ERROR(HTTP2_FRAME_SIZE_ERROR, -362)
741 
742 // Decoding or encoding of compressed HTTP/2 headers failed.
743 NET_ERROR(HTTP2_COMPRESSION_ERROR, -363)
744 
745 // Proxy Auth Requested without a valid Client Socket Handle.
746 NET_ERROR(PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION, -364)
747 
748 // HTTP_1_1_REQUIRED error code received on HTTP/2 session.
749 NET_ERROR(HTTP_1_1_REQUIRED, -365)
750 
751 // HTTP_1_1_REQUIRED error code received on HTTP/2 session to proxy.
752 NET_ERROR(PROXY_HTTP_1_1_REQUIRED, -366)
753 
754 // The PAC script terminated fatally and must be reloaded.
755 NET_ERROR(PAC_SCRIPT_TERMINATED, -367)
756 
757 // Obsolete. Kept here to avoid reuse.
758 // Request is throttled because of a Backoff header.
759 // See: crbug.com/486891.
760 // NET_ERROR(TEMPORARY_BACKOFF, -369)
761 
762 // The server was expected to return an HTTP/1.x response, but did not. Rather
763 // than treat it as HTTP/0.9, this error is returned.
764 NET_ERROR(INVALID_HTTP_RESPONSE, -370)
765 
766 // Initializing content decoding failed.
767 NET_ERROR(CONTENT_DECODING_INIT_FAILED, -371)
768 
769 // Received HTTP/2 RST_STREAM frame with NO_ERROR error code.  This error should
770 // be handled internally by HTTP/2 code, and should not make it above the
771 // SpdyStream layer.
772 NET_ERROR(HTTP2_RST_STREAM_NO_ERROR_RECEIVED, -372)
773 
774 // Obsolete. HTTP/2 push is removed.
775 // NET_ERROR(HTTP2_PUSHED_STREAM_NOT_AVAILABLE, -373)
776 
777 // Obsolete. HTTP/2 push is removed.
778 // NET_ERROR(HTTP2_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER, -374)
779 
780 // An HTTP transaction was retried too many times due for authentication or
781 // invalid certificates. This may be due to a bug in the net stack that would
782 // otherwise infinite loop, or if the server or proxy continually requests fresh
783 // credentials or presents a fresh invalid certificate.
784 NET_ERROR(TOO_MANY_RETRIES, -375)
785 
786 // Received an HTTP/2 frame on a closed stream.
787 NET_ERROR(HTTP2_STREAM_CLOSED, -376)
788 
789 // Obsolete. HTTP/2 push is removed.
790 // NET_ERROR(HTTP2_CLIENT_REFUSED_STREAM, -377)
791 
792 // Obsolete. HTTP/2 push is removed.
793 // NET_ERROR(HTTP2_PUSHED_RESPONSE_DOES_NOT_MATCH, -378)
794 
795 // The server returned a non-2xx HTTP response code.
796 //
797 // Note that this error is only used by certain APIs that interpret the HTTP
798 // response itself. URLRequest for instance just passes most non-2xx
799 // response back as success.
800 NET_ERROR(HTTP_RESPONSE_CODE_FAILURE, -379)
801 
802 // The certificate presented on a QUIC connection does not chain to a known root
803 // and the origin connected to is not on a list of domains where unknown roots
804 // are allowed.
805 NET_ERROR(QUIC_CERT_ROOT_NOT_KNOWN, -380)
806 
807 // A GOAWAY frame has been received indicating that the request has not been
808 // processed and is therefore safe to retry on a different connection.
809 NET_ERROR(QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED, -381)
810 
811 // The ACCEPT_CH restart has been triggered too many times
812 NET_ERROR(TOO_MANY_ACCEPT_CH_RESTARTS, -382)
813 
814 // The IP address space of the remote endpoint differed from the previous
815 // observed value during the same request. Any cache entry for the affected
816 // request should be invalidated.
817 NET_ERROR(INCONSISTENT_IP_ADDRESS_SPACE, -383)
818 
819 // The IP address space of the cached remote endpoint is blocked by private
820 // network access check.
821 NET_ERROR(CACHED_IP_ADDRESS_SPACE_BLOCKED_BY_PRIVATE_NETWORK_ACCESS_POLICY,
822           -384)
823 
824 // The connection is blocked by private network access checks.
825 NET_ERROR(BLOCKED_BY_PRIVATE_NETWORK_ACCESS_CHECKS, -385)
826 
827 // Content decoding failed due to the zstd window size being too big (over 8MB).
828 NET_ERROR(ZSTD_WINDOW_SIZE_TOO_BIG, -386)
829 
830 // The compression dictionary cannot be loaded.
831 NET_ERROR(DICTIONARY_LOAD_FAILED, -387)
832 
833 // The "content-dictionary" response header is unexpected. This is used both
834 // when there is no "content-dictionary" response header and when the received
835 // "content-dictionary" response header does not match the expected value.
836 NET_ERROR(UNEXPECTED_CONTENT_DICTIONARY_HEADER, -388)
837 
838 // The cache does not have the requested entry.
839 NET_ERROR(CACHE_MISS, -400)
840 
841 // Unable to read from the disk cache.
842 NET_ERROR(CACHE_READ_FAILURE, -401)
843 
844 // Unable to write to the disk cache.
845 NET_ERROR(CACHE_WRITE_FAILURE, -402)
846 
847 // The operation is not supported for this entry.
848 NET_ERROR(CACHE_OPERATION_NOT_SUPPORTED, -403)
849 
850 // The disk cache is unable to open this entry.
851 NET_ERROR(CACHE_OPEN_FAILURE, -404)
852 
853 // The disk cache is unable to create this entry.
854 NET_ERROR(CACHE_CREATE_FAILURE, -405)
855 
856 // Multiple transactions are racing to create disk cache entries. This is an
857 // internal error returned from the HttpCache to the HttpCacheTransaction that
858 // tells the transaction to restart the entry-creation logic because the state
859 // of the cache has changed.
860 NET_ERROR(CACHE_RACE, -406)
861 
862 // The cache was unable to read a checksum record on an entry. This can be
863 // returned from attempts to read from the cache. It is an internal error,
864 // returned by the SimpleCache backend, but not by any URLRequest methods
865 // or members.
866 NET_ERROR(CACHE_CHECKSUM_READ_FAILURE, -407)
867 
868 // The cache found an entry with an invalid checksum. This can be returned from
869 // attempts to read from the cache. It is an internal error, returned by the
870 // SimpleCache backend, but not by any URLRequest methods or members.
871 NET_ERROR(CACHE_CHECKSUM_MISMATCH, -408)
872 
873 // Internal error code for the HTTP cache. The cache lock timeout has fired.
874 NET_ERROR(CACHE_LOCK_TIMEOUT, -409)
875 
876 // Received a challenge after the transaction has read some data, and the
877 // credentials aren't available.  There isn't a way to get them at that point.
878 NET_ERROR(CACHE_AUTH_FAILURE_AFTER_READ, -410)
879 
880 // Internal not-quite error code for the HTTP cache. In-memory hints suggest
881 // that the cache entry would not have been usable with the transaction's
882 // current configuration (e.g. load flags, mode, etc.)
883 NET_ERROR(CACHE_ENTRY_NOT_SUITABLE, -411)
884 
885 // The disk cache is unable to doom this entry.
886 NET_ERROR(CACHE_DOOM_FAILURE, -412)
887 
888 // The disk cache is unable to open or create this entry.
889 NET_ERROR(CACHE_OPEN_OR_CREATE_FAILURE, -413)
890 
891 // The server's response was insecure (e.g. there was a cert error).
892 NET_ERROR(INSECURE_RESPONSE, -501)
893 
894 // An attempt to import a client certificate failed, as the user's key
895 // database lacked a corresponding private key.
896 NET_ERROR(NO_PRIVATE_KEY_FOR_CERT, -502)
897 
898 // An error adding a certificate to the OS certificate database.
899 NET_ERROR(ADD_USER_CERT_FAILED, -503)
900 
901 // An error occurred while handling a signed exchange.
902 NET_ERROR(INVALID_SIGNED_EXCHANGE, -504)
903 
904 // An error occurred while handling a Web Bundle source.
905 NET_ERROR(INVALID_WEB_BUNDLE, -505)
906 
907 // A Trust Tokens protocol operation-executing request failed for one of a
908 // number of reasons (precondition failure, internal error, bad response).
909 NET_ERROR(TRUST_TOKEN_OPERATION_FAILED, -506)
910 
911 // When handling a Trust Tokens protocol operation-executing request, the system
912 // was able to execute the request's Trust Tokens operation without sending the
913 // request to its destination: for instance, the results could have been present
914 // in a local cache (for redemption) or the operation could have been diverted
915 // to a local provider (for "platform-provided" issuance).
916 NET_ERROR(TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST, -507)
917 
918 // *** Code -600 is reserved (was FTP_PASV_COMMAND_FAILED). ***
919 // *** Code -601 is reserved (was FTP_FAILED). ***
920 // *** Code -602 is reserved (was FTP_SERVICE_UNAVAILABLE). ***
921 // *** Code -603 is reserved (was FTP_TRANSFER_ABORTED). ***
922 // *** Code -604 is reserved (was FTP_FILE_BUSY). ***
923 // *** Code -605 is reserved (was FTP_SYNTAX_ERROR). ***
924 // *** Code -606 is reserved (was FTP_COMMAND_NOT_SUPPORTED). ***
925 // *** Code -607 is reserved (was FTP_BAD_COMMAND_SEQUENCE). ***
926 
927 // PKCS #12 import failed due to incorrect password.
928 NET_ERROR(PKCS12_IMPORT_BAD_PASSWORD, -701)
929 
930 // PKCS #12 import failed due to other error.
931 NET_ERROR(PKCS12_IMPORT_FAILED, -702)
932 
933 // CA import failed - not a CA cert.
934 NET_ERROR(IMPORT_CA_CERT_NOT_CA, -703)
935 
936 // Import failed - certificate already exists in database.
937 // Note it's a little weird this is an error but reimporting a PKCS12 is ok
938 // (no-op).  That's how Mozilla does it, though.
939 NET_ERROR(IMPORT_CERT_ALREADY_EXISTS, -704)
940 
941 // CA import failed due to some other error.
942 NET_ERROR(IMPORT_CA_CERT_FAILED, -705)
943 
944 // Server certificate import failed due to some internal error.
945 NET_ERROR(IMPORT_SERVER_CERT_FAILED, -706)
946 
947 // PKCS #12 import failed due to invalid MAC.
948 NET_ERROR(PKCS12_IMPORT_INVALID_MAC, -707)
949 
950 // PKCS #12 import failed due to invalid/corrupt file.
951 NET_ERROR(PKCS12_IMPORT_INVALID_FILE, -708)
952 
953 // PKCS #12 import failed due to unsupported features.
954 NET_ERROR(PKCS12_IMPORT_UNSUPPORTED, -709)
955 
956 // Key generation failed.
957 NET_ERROR(KEY_GENERATION_FAILED, -710)
958 
959 // Error -711 was removed (ORIGIN_BOUND_CERT_GENERATION_FAILED)
960 
961 // Failure to export private key.
962 NET_ERROR(PRIVATE_KEY_EXPORT_FAILED, -712)
963 
964 // Self-signed certificate generation failed.
965 NET_ERROR(SELF_SIGNED_CERT_GENERATION_FAILED, -713)
966 
967 // The certificate database changed in some way.
968 NET_ERROR(CERT_DATABASE_CHANGED, -714)
969 
970 // Error -715 was removed (CHANNEL_ID_IMPORT_FAILED)
971 
972 // The certificate verifier configuration changed in some way.
973 NET_ERROR(CERT_VERIFIER_CHANGED, -716)
974 
975 // DNS error codes.
976 
977 // DNS resolver received a malformed response.
978 NET_ERROR(DNS_MALFORMED_RESPONSE, -800)
979 
980 // DNS server requires TCP
981 NET_ERROR(DNS_SERVER_REQUIRES_TCP, -801)
982 
983 // DNS server failed.  This error is returned for all of the following
984 // error conditions:
985 // 1 - Format error - The name server was unable to interpret the query.
986 // 2 - Server failure - The name server was unable to process this query
987 //     due to a problem with the name server.
988 // 4 - Not Implemented - The name server does not support the requested
989 //     kind of query.
990 // 5 - Refused - The name server refuses to perform the specified
991 //     operation for policy reasons.
992 NET_ERROR(DNS_SERVER_FAILED, -802)
993 
994 // DNS transaction timed out.
995 NET_ERROR(DNS_TIMED_OUT, -803)
996 
997 // The entry was not found in cache or other local sources, for lookups where
998 // only local sources were queried.
999 // TODO(ericorth): Consider renaming to DNS_LOCAL_MISS or something like that as
1000 // the cache is not necessarily queried either.
1001 NET_ERROR(DNS_CACHE_MISS, -804)
1002 
1003 // Suffix search list rules prevent resolution of the given host name.
1004 NET_ERROR(DNS_SEARCH_EMPTY, -805)
1005 
1006 // Failed to sort addresses according to RFC3484.
1007 NET_ERROR(DNS_SORT_ERROR, -806)
1008 
1009 // Error -807 was removed (DNS_HTTP_FAILED)
1010 
1011 // Failed to resolve the hostname of a DNS-over-HTTPS server.
1012 NET_ERROR(DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED, -808)
1013 
1014 // DNS identified the request as disallowed for insecure connection (http/ws).
1015 // Error should be handled as if an HTTP redirect was received to redirect to
1016 // https or wss.
1017 NET_ERROR(DNS_NAME_HTTPS_ONLY, -809)
1018 
1019 // All DNS requests associated with this job have been cancelled.
1020 NET_ERROR(DNS_REQUEST_CANCELLED, -810)
1021 
1022 // The hostname resolution of HTTPS record was expected to be resolved with
1023 // alpn values of supported protocols, but did not.
1024 NET_ERROR(DNS_NO_MATCHING_SUPPORTED_ALPN, -811)
1025 
1026 // Error -812 was removed
1027 // Error -813 was removed
1028 
1029 // When checking whether secure DNS can be used, the response returned for the
1030 // requested probe record either had no answer or was invalid.
1031 NET_ERROR(DNS_SECURE_PROBE_RECORD_INVALID, -814)
1032 
1033 // CAUTION: Before adding errors here, please check the ranges of errors written
1034 // in the top of this file.
1035