错误码在实际使用中,为了追查问题,会不断增加及更新。
说明
本表仅供实际使用参考使用。
| 错误码 | 说明 |
|---|---|
| -1 | NSURLErrorUnknown |
| -4 | // An argument to the function is incorrect. NET_ERROR(INVALID_ARGUMENT, -4 |
| -5 | 域名解析异常 |
| -9 | // An unexpected error. This may be caused by a programming mistake or aninvalid assumption. NET_ERROR(UNEXPECTED, -9 |
| -11 | |
| -13 | Memory allocation failed. NET_ERROR(OUT_OF_MEMORY, -13 |
| -35 | EROFS |
| -54 | // previous handshake message. QUIC_CRYPTO_MESSAGE_WHILE_VALIDATING_CLIENT_HELLO = 54 |
| -60 | Socket 超时(iOS) |
| -61 | // Received STREAM frame data is not encrypted. QUIC_UNENCRYPTED_STREAM_DATA = 61 |
| -101 | 路由不可达 |
| -103 | // A connection timed out as a result of not receiving an ACK for data sent.This can include a FIN packet that did not get ACK'd. NET_ERROR(CONNECTION_ABORTED, -103 |
| -104 | // A connection attempt failed. NET_ERROR(CONNECTION_FAILED, -104 |
| -105 | The host name could not be resolved. |
| -110 | Socket 超时(Android) |
| -111 | // A tunnel connection through the proxy could not be established. NET_ERROR(TUNNEL_CONNECTION_FAILED, -111 |
| -113 | The client and server don't support a common SSL protocol version or cipher suite. NET_ERROR(SSL_VERSION_OR_CIPHER_MISMATCH, -113 |
| -541478725 | AVERROR_EOF |
| -1414092869 | 用户中止上传 |
| 错误码 | 说明 |
|---|---|
| 504 | // Server does not support the command we issued. // FTP response codes 502, 504. |
| 503 | // Server rejected our command because we didn't issue the commands in right // order. // FTP response code 503. |
| 502 | // Server does not support the command we issued. // FTP response codes 502, 504. |
| 500 | |
| 414 | 400-499 Cache errors |
| 410 | 400-499 Cache errors |
| 404 | 400-499 Cache errors |
| 403 | 400-499 Cache errors |
| 401 | 400-499 Cache errors |
| 400 | 400-499 Cache errors |
| 310 | |
| 200 | 200-299 Certificate errors |
| 53 | // We failed to setup the symmetric keys for a connection. QUIC_CRYPTO_SYMMETRIC_KEY_SETUP_FAILED = 53 |
| 41 | // The server rejected our client hello messages too many times. QUIC_CRYPTO_TOO_MANY_REJECTS = 41 |
| 36 | 权限被拒绝 |
| 33 | 文件或目录不存在 |
| 22 | The Header ID for a stream was too far from the previous. QUIC_INVALID_HEADER_ID = 22 |
| 11 | 未知主机,域名解析失败 |
| 9 | no route to host |
| 8 | 连接出现异常 |
| 6 | 对方关闭了连接 |
| 5 | SOCKET 出错 |
| 4 | // Frame data is malformed. QUIC_INVALID_FRAME_DATA = 4 |
| 3 | SOCKET超时 |
| 2 | 连接超时 |
| 1 | 未知错误 |
| -2 | // A generic failure occurred. NET_ERROR(FAILED, -2) |
| -5 | // The handle or file descriptor is invalid. NET_ERROR(INVALID_HANDLE, -5) |
| -7 | An operation timed out. |
| -13 | // Memory allocation failed. NET_ERROR(OUT_OF_MEMORY, -13) |
| -15 | The socket is not connected. |
| -21 | // The network changed. NET_ERROR(NETWORK_CHANGED, -21 |
| -100 | // A connection was closed (corresponding to a TCP FIN). NET_ERROR(CONNECTION_CLOSED, -100) |
| -101 | A connection was reset |
| -102 | A connection attempt was refused. |
| -104 | // A connection attempt failed. NET_ERROR(CONNECTION_FAILED, -104) |
| -105 | The host name could not be resolved. |
| -106 | The Internet connection has been lost. |
| -107 | An SSL protocol error occurred. |
| -108 | // The IP address or port number is invalid (e.g., cannot connect to the IP // address 0 or the port 0). NET_ERROR(ADDRESS_INVALID, -108) |
| -109 | The IP address is unreachable. |
| -111 | // A tunnel connection through the proxy could not be established. NET_ERROR(TUNNEL_CONNECTION_FAILED, -111) |
| -113 | The client and server don't support a common SSL protocol version or // cipher suite. NET_ERROR(SSL_VERSION_OR_CIPHER_MISMATCH, -113) |
| -118 | // A connection attempt timed out. NET_ERROR(CONNECTION_TIMED_OUT, -118) |
| -126 | // An SSL peer sent us a fatal bad_record_mac alert. This has been observed // from servers with buggy DEFLATE support. NET_ERROR(SSL_BAD_RECORD_MAC_ALERT, -126) |
| -130 | // Could not create a connection to the proxy server. An error occurred // either in resolving its name, or in connecting a socket to it. // Note that this does NOT include failures during the actual "CONNECT" method // of an HTTP proxy. NET_ERROR(PROXY_CONNECTION_FAILED, -130) |
| -138 | // Permission to access the network was denied. This is used to distinguish // errors that were most likely caused by a firewall from other access denied // errors. See also ERR_ACCESS_DENIED. NET_ERROR(NETWORK_ACCESS_DENIED, -138) |
| -153 | An SSL peer sent us a fatal decrypt_error alert. This typically occurs when // a peer could not correctly verify a signature (in CertificateVerify or // ServerKeyExchange) or validate a Finished message. NET_ERROR(SSL_DECRYPT_ERROR_ALERT, -153) |
| -167 | // The SSL server presented a certificate which could not be decoded. This is // not a certificate error code as no X509Certificate object is available. This // error is fatal. NET_ERROR(SSL_SERVER_CERT_BAD_FORMAT, -167) |
| -200 | // Certificate error codes // // The values of certificate error codes must be consecutive. // The server responded with a certificate whose common name did not match // the host name. This could mean: // // 1. An attacker has redirected our traffic to their server and is // presenting a certificate for which they know the private key. // // 2. The server is misconfigured and responding with the wrong cert. // // 3. The user is on a wireless network and is being redirected to the // network's login page. // // 4. The OS has used a DNS search suffix and the server doesn't have // a certificate for the abbreviated name in the address bar. // NET_ERROR(CERT_COMMON_NAME_INVALID, -200) |
| -201 | // The server responded with a certificate that, by our clock, appears to // either not yet be valid or to have expired. This could mean: // // 1. An attacker is presenting an old certificate for which they have // managed to obtain the private key. // // 2. The server is misconfigured and is not presenting a valid cert. // // 3. Our clock is wrong. // NET_ERROR(CERT_DATE_INVALID, -201) |
| -202 | // The server responded with a certificate that is signed by an authority // we don't trust. The could mean: // // 1. An attacker has substituted the real certificate for a cert that // contains their public key and is signed by their cousin. // // 2. The server operator has a legitimate certificate from a CA we don't // know about, but should trust. // // 3. The server is presenting a self-signed certificate, providing no // defense against active attackers (but foiling passive attackers). // NET_ERROR(CERT_AUTHORITY_INVALID, -202 |
| -207 | // The server responded with a certificate that is invalid. // This error is not recoverable. // // MSDN describes this error as follows: // "The SSL certificate is invalid." // NET_ERROR(CERT_INVALID, -207) |
| -300 | // The URL is invalid. NET_ERROR(INVALID_URL, -300) |
| -302 | // The scheme of the URL is unknown. NET_ERROR(UNKNOWN_URL_SCHEME, -302) |
| -310 | // Attempting to load an URL resulted in too many redirects. NET_ERROR(TOO_MANY_REDIRECTS, -310) |
| -321 | Error in chunked transfer encoding. NET_ERROR(INVALID_CHUNKED_ENCODING, -321) |
| -323 | // The response was 407 (Proxy Authentication Required), yet we did not send // the request to a proxy. NET_ERROR(UNEXPECTED_PROXY_AUTH, -323) |
| -324 | // The server closed the connection without sending any data. NET_ERROR(EMPTY_RESPONSE, -324) |
| -337 | // There is a SPDY protocol error. NET_ERROR(SPDY_PROTOCOL_ERROR, -337) |
| -352 | // SPDY server didn't respond to the PING message. NET_ERROR(SPDY_PING_FAILED, -352) |
| -354 | // The HTTP response body transferred fewer bytes than were advertised by the // Content-Length header when the connection is closed. NET_ERROR(CONTENT_LENGTH_MISMATCH, -354) |
| -355 | // The HTTP response body is transferred with Chunked-Encoding, but the // terminating zero-length chunk was never sent when the connection is closed. NET_ERROR(INCOMPLETE_CHUNKED_ENCODING, -355) |
| -370 | The server was expected to return an HTTP/1.x response, but did not. Rather // than treat it as HTTP/0.9, this error is returned. NET_ERROR(INVALID_HTTP_RESPONSE, -370) |
| -999 | NSURLErrorCancelled |
| -1000 | NSURLErrorBadURL |
| -1002 | NSURLErrorUnsupportedURL |
| -1003 | NSURLErrorCannotFindHost |
| -1004 | NSURLErrorCannotConnectToHost |
| -1005 | NSURLErrorNetworkConnectionLost |
| -1007 | NSURLErrorHTTPTooManyRedirects |
| -1009 | NSURLErrorNotConnectedToInternet |
| -1011 | NSURLErrorBadServerResponse |
| -1014 | NSURLErrorZeroByteResource |
| -1019 | NSURLErrorCallIsActive NS_ENUM_AVAILABLE(10_7, 3_0) |
| -1020 | NSURLErrorDataNotAllowed NS_ENUM_AVAILABLE(10_7, 3_0) |
| -1200 | NSURLErrorSecureConnectionFailed |
| -1202 | NSURLErrorServerCertificateUntrusted |
| NSURLErrorTimedOut |
| 错误码 | 错误信息描述 |
|---|---|
| -1 | "IO_PENDING", |
| -2 | "FAILED", |
| -3 | "ABORTED", |
| -4 | "INVALID_ARGUMENT", |
| -5 | "INVALID_HANDLE", |
| -6 | "FILE_NOT_FOUND", |
| -7 | "TIMED_OUT", |
| -8 | "FILE_TOO_BIG", |
| -9 | "UNEXPECTED", |
| -10 | "ACCESS_DENIED", |
| -11 | "NOT_IMPLEMENTED", |
| -12 | "INSUFFICIENT_RESOURCES", |
| -13 | "OUT_OF_MEMORY", |
| -14 | "UPLOAD_FILE_CHANGED", |
| -15 | "SOCKET_NOT_CONNECTED", |
| -16 | "FILE_EXISTS", |
| -17 | "FILE_PATH_TOO_LONG", |
| -18 | "FILE_NO_SPACE", |
| -19 | "FILE_VIRUS_INFECTED", |
| -20 | "BLOCKED_BY_CLIENT", |
| -21 | "NETWORK_CHANGED", |
| -22 | "BLOCKED_BY_ADMINISTRATOR", |
| -23 | "SOCKET_IS_CONNECTED", |
| -24 | "BLOCKED_ENROLLMENT_CHECK_PENDING", |
| -25 | "UPLOAD_STREAM_REWIND_NOT_SUPPORTED", |
| -26 | "CONTEXT_SHUT_DOWN", |
| -27 | "BLOCKED_BY_RESPONSE", |
| -28 | "BLOCKED_BY_XSS_AUDITOR", |
| -29 | "CLEARTEXT_NOT_PERMITTED", |
| -100 | "CONNECTION_CLOSED", |
| -101 | "CONNECTION_RESET", |
| -102 | "CONNECTION_REFUSED", |
| -103 | "CONNECTION_ABORTED", |
| -104 | "CONNECTION_FAILED", |
| -105 | "NAME_NOT_RESOLVED", |
| -106 | "INTERNET_DISCONNECTED", |
| -107 | "SSL_PROTOCOL_ERROR", |
| -108 | "ADDRESS_INVALID", |
| -109 | "ADDRESS_UNREACHABLE", |
| -110 | "SSL_CLIENT_AUTH_CERT_NEEDED", |
| -111 | "TUNNEL_CONNECTION_FAILED", |
| -112 | "NO_SSL_VERSIONS_ENABLED", |
| -113 | "SSL_VERSION_OR_CIPHER_MISMATCH", |
| -114 | "SSL_RENEGOTIATION_REQUESTED", |
| -115 | "PROXY_AUTH_UNSUPPORTED", |
| -116 | "CERT_ERROR_IN_SSL_RENEGOTIATION", |
| -117 | "BAD_SSL_CLIENT_AUTH_CERT", |
| -118 | "CONNECTION_TIMED_OUT", |
| -119 | "HOST_RESOLVER_QUEUE_TOO_LARGE", |
| -120 | "SOCKS_CONNECTION_FAILED", |
| -121 | "SOCKS_CONNECTION_HOST_UNREACHABLE", |
| -122 | "ALPN_NEGOTIATION_FAILED", |
| -123 | "SSL_NO_RENEGOTIATION", |
| -124 | "WINSOCK_UNEXPECTED_WRITTEN_BYTES", |
| -125 | "SSL_DECOMPRESSION_FAILURE_ALERT", |
| -126 | "SSL_BAD_RECORD_MAC_ALERT", |
| -127 | "PROXY_AUTH_REQUESTED", |
| -129 | "SSL_WEAK_SERVER_EPHEMERAL_DH_KEY", |
| -130 | "PROXY_CONNECTION_FAILED", |
| -131 | "MANDATORY_PROXY_CONFIGURATION_FAILED", |
| -132 | "ERR_ESET_ANTI_VIRUS_SSL_INTERCEPTION", |
| -133 | "PRECONNECT_MAX_SOCKET_LIMIT", |
| -134 | "SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED", |
| -135 | "SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY", |
| -136 | "PROXY_CERTIFICATE_INVALID", |
| -137 | "NAME_RESOLUTION_FAILED", |
| -138 | "NETWORK_ACCESS_DENIED", |
| -139 | "TEMPORARILY_THROTTLED", |
| -140 | "HTTPS_PROXY_TUNNEL_RESPONSE", |
| -141 | "SSL_CLIENT_AUTH_SIGNATURE_FAILED", |
| -142 | "MSG_TOO_BIG", |
| -143 | "SPDY_SESSION_ALREADY_EXISTS", |
| -145 | "WS_PROTOCOL_ERROR", |
| -147 | "ADDRESS_IN_USE", |
| -148 | "SSL_HANDSHAKE_NOT_COMPLETED", |
| -149 | "SSL_BAD_PEER_PUBLIC_KEY", |
| -150 | "SSL_PINNED_KEY_NOT_IN_CERT_CHAIN", |
| -151 | "CLIENT_AUTH_CERT_TYPE_UNSUPPORTED", |
| -152 | "ORIGIN_BOUND_CERT_GENERATION_TYPE_MISMATCH", |
| -153 | "SSL_DECRYPT_ERROR_ALERT", |
| -154 | "WS_THROTTLE_QUEUE_TOO_LARGE", |
| -156 | "SSL_SERVER_CERT_CHANGED", |
| -159 | "SSL_UNRECOGNIZED_NAME_ALERT", |
| -160 | "SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR", |
| -161 | "SOCKET_SET_SEND_BUFFER_SIZE_ERROR", |
| -162 | "SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE", |
| -163 | "SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE", |
| -164 | "SSL_CLIENT_AUTH_CERT_BAD_FORMAT", |
| -166 | "ICANN_NAME_COLLISION", |
| -167 | "SSL_SERVER_CERT_BAD_FORMAT", |
| -168 | "CT_STH_PARSING_FAILED", |
| -169 | "CT_STH_INCOMPLETE", |
| -170 | "UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH", |
| -171 | "CT_CONSISTENCY_PROOF_PARSING_FAILED", |
| -172 | "SSL_OBSOLETE_CIPHER", |
| -173 | "WS_UPGRADE", |
| -196 | "TTNET_UNSUPPORTED_REDIRECT", |
| -197 | "TTNET_APP_UPLOAD_EXCEPTION", |
| -198 | "TTNET_CONNECTION_TIMED_OUT", |
| -199 | "TTNET_APP_TIMED_OUT", |
| -200 | "CERT_COMMON_NAME_INVALID", |
| -201 | "CERT_DATE_INVALID", |
| -202 | "CERT_AUTHORITY_INVALID", |
| -203 | "CERT_CONTAINS_ERRORS", |
| -204 | "CERT_NO_REVOCATION_MECHANISM", |
| -205 | "CERT_UNABLE_TO_CHECK_REVOCATION", |
| -206 | "CERT_REVOKED", |
| -207 | "CERT_INVALID", |
| -208 | "CERT_WEAK_SIGNATURE_ALGORITHM", |
| -210 | "CERT_NON_UNIQUE_NAME", |
| -211 | "CERT_WEAK_KEY", |
| -212 | "CERT_NAME_CONSTRAINT_VIOLATION", |
| -213 | "CERT_VALIDITY_TOO_LONG", |
| -214 | "CERTIFICATE_TRANSPARENCY_REQUIRED", |
| -215 | "CERT_END", |
| -300 | "INVALID_URL", |
| -301 | "DISALLOWED_URL_SCHEME", |
| -302 | "UNKNOWN_URL_SCHEME", |
| -310 | "TOO_MANY_REDIRECTS", |
| -311 | "UNSAFE_REDIRECT", |
| -312 | "UNSAFE_PORT", |
| -320 | "INVALID_RESPONSE", |
| -321 | "INVALID_CHUNKED_ENCODING", |
| -322 | "METHOD_NOT_SUPPORTED", |
| -323 | "UNEXPECTED_PROXY_AUTH", |
| -324 | "EMPTY_RESPONSE", |
| -325 | "RESPONSE_HEADERS_TOO_BIG", |
| -326 | "PAC_STATUS_NOT_OK", |
| -327 | "PAC_SCRIPT_FAILED", |
| -328 | "REQUEST_RANGE_NOT_SATISFIABLE", |
| -329 | "MALFORMED_IDENTITY", |
| -330 | "CONTENT_DECODING_FAILED", |
| -331 | "NETWORK_IO_SUSPENDED", |
| -332 | "SYN_REPLY_NOT_RECEIVED", |
| -333 | "ENCODING_CONVERSION_FAILED", |
| -334 | "UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT", |
| -335 | "INVALID_SPDY_STREAM", |
| -336 | "NO_SUPPORTED_PROXIES", |
| -337 | "SPDY_PROTOCOL_ERROR", |
| -338 | "INVALID_AUTH_CREDENTIALS", |
| -339 | "UNSUPPORTED_AUTH_SCHEME", |
| -340 | "ENCODING_DETECTION_FAILED", |
| -341 | "MISSING_AUTH_CREDENTIALS", |
| -342 | "UNEXPECTED_SECURITY_LIBRARY_STATUS", |
| -343 | "MISCONFIGURED_AUTH_ENVIRONMENT", |
| -344 | "UNDOCUMENTED_SECURITY_LIBRARY_STATUS", |
| -345 | "RESPONSE_BODY_TOO_BIG_TO_DRAIN", |
| -346 | "RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH", |
| -347 | "INCOMPLETE_SPDY_HEADERS", |
| -348 | "PAC_NOT_IN_DHCP", |
| -349 | "RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION", |
| -350 | "RESPONSE_HEADERS_MULTIPLE_LOCATION", |
| -351 | "SPDY_SERVER_REFUSED_STREAM", |
| -352 | "SPDY_PING_FAILED", |
| -353 | "PIPELINE_EVICTION", |
| -354 | "CONTENT_LENGTH_MISMATCH", |
| -355 | "INCOMPLETE_CHUNKED_ENCODING", |
| -356 | "QUIC_PROTOCOL_ERROR", |
| -357 | "RESPONSE_HEADERS_TRUNCATED", |
| -358 | "QUIC_HANDSHAKE_FAILED", |
| -359 | "REQUEST_FOR_SECURE_RESOURCE_OVER_INSECURE_QUIC", |
| -360 | "SPDY_INADEQUATE_TRANSPORT_SECURITY", |
| -361 | "SPDY_FLOW_CONTROL_ERROR", |
| -362 | "SPDY_FRAME_SIZE_ERROR", |
| -363 | "SPDY_COMPRESSION_ERROR", |
| -364 | "PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION", |
| -365 | "HTTP_1_1_REQUIRED", |
| -366 | "PROXY_HTTP_1_1_REQUIRED", |
| -367 | "PAC_SCRIPT_TERMINATED", |
| -370 | "INVALID_HTTP_RESPONSE", |
| -371 | "CONTENT_DECODING_INIT_FAILED", |
| -372 | "SPDY_RST_STREAM_NO_ERROR_RECEIVED", |
| -400 | "CACHE_MISS", |
| -401 | "CACHE_READ_FAILURE", |
| -402 | "CACHE_WRITE_FAILURE", |
| -403 | "CACHE_OPERATION_NOT_SUPPORTED", |
| -404 | "CACHE_OPEN_FAILURE", |
| -405 | "CACHE_CREATE_FAILURE", |
| -406 | "CACHE_RACE", |
| -407 | "CACHE_CHECKSUM_READ_FAILURE", |
| -408 | "CACHE_CHECKSUM_MISMATCH", |
| -409 | "CACHE_LOCK_TIMEOUT", |
| -410 | "CACHE_AUTH_FAILURE_AFTER_READ", |
| -501 | "INSECURE_RESPONSE", |
| -502 | "NO_PRIVATE_KEY_FOR_CERT", |
| -503 | "ADD_USER_CERT_FAILED", |
| -601 | "FTP_FAILED", |
| -602 | "FTP_SERVICE_UNAVAILABLE", |
| -603 | "FTP_TRANSFER_ABORTED", |
| -604 | "FTP_FILE_BUSY", |
| -605 | "FTP_SYNTAX_ERROR", |
| -606 | "FTP_COMMAND_NOT_SUPPORTED", |
| -607 | "FTP_BAD_COMMAND_SEQUENCE", |
| -701 | "PKCS12_IMPORT_BAD_PASSWORD", |
| -702 | "PKCS12_IMPORT_FAILED", |
| -703 | "IMPORT_CA_CERT_NOT_CA", |
| -704 | "IMPORT_CERT_ALREADY_EXISTS", |
| -705 | "IMPORT_CA_CERT_FAILED", |
| -706 | "IMPORT_SERVER_CERT_FAILED", |
| -707 | "PKCS12_IMPORT_INVALID_MAC", |
| -708 | "PKCS12_IMPORT_INVALID_FILE", |
| -709 | "PKCS12_IMPORT_UNSUPPORTED", |
| -710 | "KEY_GENERATION_FAILED", |
| -712 | "PRIVATE_KEY_EXPORT_FAILED", |
| -713 | "SELF_SIGNED_CERT_GENERATION_FAILED", |
| -714 | "CERT_DATABASE_CHANGED", |
| -800 | "DNS_MALFORMED_RESPONSE", |
| -801 | "DNS_SERVER_REQUIRES_TCP", |
| -802 | "DNS_SERVER_FAILED", |
| -803 | "DNS_TIMED_OUT", |
| -804 | "DNS_CACHE_MISS", |
| -805 | "DNS_SEARCH_EMPTY", |
| -806 | "DNS_SORT_ERROR", |