CURL错误码

curl error code备忘。


CURLE_OK (0)
成功。
All fine. Proceed as usual.

CURLE_UNSUPPORTED_PROTOCOL (1)
不支持的协议。
The URL you passed to libcurl used a protocol that this libcurl does not support. The support might be a compile-time option that you didn’t use, it can be a misspelled protocol string or just a protocol libcurl has no code for.

CURLE_FAILED_INIT (2)
初始化失败。
Very early initialization code failed. This is likely to be an internal error or problem, or a resource problem where something fundamental couldn’t get done at init time.

CURLE_URL_MALFORMAT (3)
URL格式不正确。
The URL was not properly formatted.

CURLE_NOT_BUILT_IN (4)
某些选项未被配置,可能需要重新编译。
A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. This means that a feature or option was not enabled or explicitly disabled when libcurl was built and in order to get it to function you have to get a rebuilt libcurl.

CURLE_COULDNT_RESOLVE_PROXY (5)
无法解析代理。给定的代理主机无法解析。
Couldn’t resolve proxy. The given proxy host could not be resolved.

CURLE_COULDNT_RESOLVE_HOST (6)
无法解析主机,给定的远程主机无法解析。
Couldn’t resolve host. The given remote host was not resolved.

CURLE_COULDNT_CONNECT (7)
连接主机或代理失败。
Failed to connect() to host or proxy.

CURLE_FTP_WEIRD_SERVER_REPLY (8)
libcurl无法解析服务器发送的数据。
The server sent data libcurl couldn’t parse. This error code is used for more than just FTP and is aliased as CURLE_WEIRD_SERVER_REPLY since 7.51.0.

CURLE_REMOTE_ACCESS_DENIED (9)
URL指定的资源被拒绝访问。
We were denied access to the resource given in the URL. For FTP, this occurs while trying to change to the remote directory.

CURLE_FTP_ACCEPT_FAILED (10)
在等待一个活动的ftp server返回时,错误码被发送到错误连接或相似的地方。
While waiting for the server to connect back when an active FTP session is used, an error code was sent over the control connection or similar.

CURLE_FTP_WEIRD_PASS_REPLY (11)
发送FTP密码到服务器后,libcurl未等到一个期望的返回。很大可能是密码有问题。
After having sent the FTP password to the server, libcurl expects a proper reply. This error code indicates that an unexpected code was returned.

CURLE_FTP_ACCEPT_TIMEOUT (12)
应答超时。
During an active FTP session while waiting for the server to connect, the CURLOPT_ACCEPTTIMEOUT_MS (or the internal default) timeout expired.

CURLE_FTP_WEIRD_PASV_REPLY (13)
libcurl无法解析一个非正常的PASV或EPSV返回,服务器可能不正常。
libcurl failed to get a sensible result back from the server as a response to either a PASV or a EPSV command. The server is flawed.

CURLE_FTP_WEIRD_227_FORMAT (14)
libcurl无法解析服务器返回的非正常的PASV 227行响应。
FTP servers return a 227-line as a response to a PASV command. If libcurl fails to parse that line, this return code is passed back.

CURLE_FTP_CANT_GET_HOST (15)
内部错误,无法连接到主机。
An internal failure to lookup the host used for the new connection.

CURLE_HTTP2 (16)
一个存在于HTTP2框架层的问题。
A problem was detected in the HTTP2 framing layer. This is somewhat generic and can be one out of several problems, see the error buffer for details.

CURLE_FTP_COULDNT_SET_TYPE (17)
设置binary或ASCII模式时返回错误。
Received an error when trying to set the transfer mode to binary or ASCII.

CURLE_PARTIAL_FILE (18)
被传输的文件与期望不符合。
A file transfer was shorter or larger than expected. This happens when the server first reports an expected transfer size, and then delivers data that doesn’t match the previously given size.

CURLE_FTP_COULDNT_RETR_FILE (19)
RETR命令返回了一个非预期的回应,或一个0字节传送完成。??
This was either a weird reply to a ‘RETR’ command or a zero byte transfer complete.

CURLE_QUOTE_ERROR (21)
QUOTE命令返回错误。
When sending custom “QUOTE” commands to the remote server, one of the commands returned an error code that was 400 or higher (for FTP) or otherwise indicated unsuccessful completion of the command.

CURLE_HTTP_RETURNED_ERROR (22)
当CURLOPT_FAILONERROR设置为TRUE时,或HTTP服务器返回的错误码>=400时会报此错误。
This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server returns an error code that is >= 400.

CURLE_WRITE_ERROR (23)
写入失败。
An error occurred when writing received data to a local file, or an error was returned to libcurl from a write callback.

CURLE_UPLOAD_FAILED (25)
上传失败。
Failed starting the upload. For FTP, the server typically denied the STOR command. The error buffer usually contains the server’s explanation for this.

CURLE_READ_ERROR (26)
读取失败。
There was a problem reading a local file or an error returned by the read callback.

CURLE_OUT_OF_MEMORY (27)
请求分配内存失败。
A memory allocation request failed. This is serious badness and things are severely screwed up if this ever occurs.

CURLE_OPERATION_TIMEDOUT (28)
操作超时。
Operation timeout. The specified time-out period was reached according to the conditions.

CURLE_FTP_PORT_FAILED (30)
FTP端口错误。
The FTP PORT command returned error. This mostly happens when you haven’t specified a good enough address for libcurl to use. See CURLOPT_FTPPORT.

CURLE_FTP_COULDNT_USE_REST (31)
FTP REST命令返回错误。服务器正常的话这个错误应该永远不会发生。
The FTP REST command returned error. This should never happen if the server is sane.

CURLE_RANGE_ERROR (33)
不支持RANGE请求。
The server does not support or accept range requests.

CURLE_HTTP_POST_ERROR (34)
这是一个主要由内部混乱引发的错误。
This is an odd error that mainly occurs due to internal confusion.

CURLE_SSL_CONNECT_ERROR (35)
SSL连接失败。可能是证书、密码或其它的有问题。
A problem occurred somewhere in the SSL/TLS handshake. You really want the error buffer and read the message there as it pinpoints the problem slightly more. Could be certificates (file formats, paths, permissions), passwords, and others.

CURLE_BAD_DOWNLOAD_RESUME (36)
因为指定的偏移量超出了文件范围,下载无法恢复。
The download could not be resumed because the specified offset was out of the file boundary.

CURLE_FILE_COULDNT_READ_FILE (37)
文件无法打开。可能因为文件不存在或权限问题。
A file given with FILE:// couldn’t be opened. Most likely because the file path doesn’t identify an existing file. Did you check file permissions?

CURLE_LDAP_CANNOT_BIND (38)
LDAP绑定失败。
LDAP cannot bind. LDAP bind operation failed.

CURLE_LDAP_SEARCH_FAILED (39)
LDAP搜索失败。
LDAP search failed.

CURLE_FUNCTION_NOT_FOUND (41)
未找到请求的zlib方法。
Function not found. A required zlib function was not found.

CURLE_ABORTED_BY_CALLBACK (42)
回调中止。
Aborted by callback. A callback returned “abort” to libcurl.

CURLE_BAD_FUNCTION_ARGUMENT (43)
内部错误,参数不对。
Internal error. A function was called with a bad parameter.

CURLE_INTERFACE_FAILED (45)
接口错误。指定的发送(输出)接口无法使用。使用选项CURLOPT_INTERFACE设置接口。
Interface error. A specified outgoing interface could not be used. Set which interface to use for outgoing connections’ source IP address with CURLOPT_INTERFACE.

CURLE_TOO_MANY_REDIRECTS (47)
太多的重定向。
Too many redirects. When following redirects, libcurl hit the maximum amount. Set your limit with CURLOPT_MAXREDIRS.

CURLE_UNKNOWN_OPTION (48)
未知选项。
An option passed to libcurl is not recognized/known. Refer to the appropriate documentation. This is most likely a problem in the program that uses libcurl. The error buffer might contain more specific information about which exact option it concerns.

CURLE_TELNET_OPTION_SYNTAX (49)
TELNET选项不符合格式。
A telnet option string was Illegally formatted.

CURLE_PEER_FAILED_VERIFICATION (51)
检验失败。远程服务器的SSL证书或SSH MD5加密不正确。
The remote server’s SSL certificate or SSH md5 fingerprint was deemed not OK.

CURLE_GOT_NOTHING (52)
服务器没有返回。
Nothing was returned from the server, and under the circumstances, getting nothing is considered an error.

CURLE_SSL_ENGINE_NOTFOUND (53)
未找到指定的SSL加密方法。
The specified crypto engine wasn’t found.

CURLE_SSL_ENGINE_SETFAILED (54)
设置SSL默认加密方法失败。
Failed setting the selected SSL crypto engine as default!

CURLE_SEND_ERROR (55)
发送网络数据失败。
Failed sending network data.

CURLE_RECV_ERROR (56)
接收网络数据失败。
Failure with receiving network data.

CURLE_SSL_CERTPROBLEM (58)
客户端证书有问题。
problem with the local client certificate.

CURLE_SSL_CIPHER (59)
无法使用指定的SSL密码。
Couldn’t use specified cipher.

CURLE_SSL_CACERT (60)
已知的CA无法认证此对等证书。
Peer certificate cannot be authenticated with known CA certificates.

CURLE_BAD_CONTENT_ENCODING (61)
错误的编码方式。
Unrecognized transfer encoding.

CURLE_LDAP_INVALID_URL (62)
无效的LDAP URL。
Invalid LDAP URL.

CURLE_FILESIZE_EXCEEDED (63)
文件过大,超过限制。
Maximum file size exceeded.

CURLE_USE_SSL_FAILED (64)
请求SSL等级的FTP失败。
Requested FTP SSL level failed.

CURLE_SEND_FAIL_REWIND (65)
重传失败。
When doing a send operation curl had to rewind the data to retransmit, but the rewinding operation failed.

CURLE_SSL_ENGINE_INITFAILED (66)
初始化SSL引擎失败。
Initiating the SSL Engine failed.

CURLE_LOGIN_DENIED (67)
登录失败。远程服务器拒绝登录。
The remote server denied curl to login (Added in 7.13.1)

CURLE_TFTP_NOTFOUND (68)
TFTP服务器上未找到文件。
File not found on TFTP server.

CURLE_TFTP_PERM (69)
TFTP服务器有权限问题。
Permission problem on TFTP server.

CURLE_REMOTE_DISK_FULL (70)
服务器磁盘可用空间不足。
Out of disk space on the server.

CURLE_TFTP_ILLEGAL (71)
非法的TFTP操作。
Illegal TFTP operation.

CURLE_TFTP_UNKNOWNID (72)
未知的TFTP传输ID。
Unknown TFTP transfer ID.

CURLE_REMOTE_FILE_EXISTS (73)
文件存在并且不会被覆盖。
File already exists and will not be overwritten.

CURLE_TFTP_NOSUCHUSER (74)
正常运行的TFTP服务器应该永远不会返回这个错误。
This error should never be returned by a properly functioning TFTP server.

CURLE_CONV_FAILED (75)
字符转换失败。
Character conversion failed.

CURLE_CONV_REQD (76)
调用者必须注册转换回调方法。
Caller must register conversion callbacks.

CURLE_SSL_CACERT_BADFILE (77)
读取SSL证书失败。
Problem with reading the SSL CA cert (path? access rights?)

CURLE_REMOTE_FILE_NOT_FOUND (78)
URL引用的资源不存在。
The resource referenced in the URL does not exist.

CURLE_SSH (79)
一个在SSH会话中发生的未指明的错误。
An unspecified error occurred during the SSH session.

CURLE_SSL_SHUTDOWN_FAILED (80)
关闭SSL连接失败。
Failed to shut down the SSL connection.

CURLE_AGAIN (81)
socket未准备好,等socket准备好后重试。
Socket is not ready for send/recv wait till it’s ready and try again. This return code is only returned from curl_easy_recv and curl_easy_send (Added in 7.18.2)

CURLE_SSL_CRL_BADFILE (82)
加载CRL文件失败(证书废止列表)。
Failed to load CRL file (Added in 7.19.0)

CURLE_SSL_ISSUER_ERROR (83)
发行者检查失败。
Issuer check failed (Added in 7.19.0)

CURLE_FTP_PRET_FAILED (84)
FTP服务器不理解PRET命令,或不支持给定的参数。使用CURLOPT_CUSTOMREQUEST时需要小心。
The FTP server does not understand the PRET command at all or does not support the given argument. Be careful when using CURLOPT_CUSTOMREQUEST, a custom LIST command will be sent with PRET CMD before PASV as well. (Added in 7.20.0)

CURLE_RTSP_CSEQ_ERROR (85)
RTSP CSeq号码不匹配。
Mismatch of RTSP CSeq numbers.

CURLE_RTSP_SESSION_ERROR (86)
RTSP会话标识不匹配。
Mismatch of RTSP Session Identifiers.

CURLE_FTP_BAD_FILE_LIST (87)
无法解析FTP文件列表。
Unable to parse FTP file list (during FTP wildcard downloading).

CURLE_CHUNK_FAILED (88)
块回调报告错误。
Chunk callback reported error.

CURLE_NO_CONNECTION_AVAILABLE (89)
(内部专用,不会被libcurl返回)没有可用连接,会话将会进入队列。
(For internal use only, will never be returned by libcurl) No connection available, the session will be queued. (added in 7.30.0)

CURLE_SSL_PINNEDPUBKEYNOTMATCH (90)
匹配通过CURLOPT_PINNEDPUBLICKEY指定的密钥失败。
Failed to match the pinned key specified with CURLOPT_PINNEDPUBLICKEY.

CURLE_SSL_INVALIDCERTSTATUS (91)
无效的证书状态。
Status returned failure when asked with CURLOPT_SSL_VERIFYSTATUS.

CURLE_HTTP2_STREAM (92)
HTTP2框架层stream错误。
Stream error in the HTTP/2 framing layer.

CURLE_OBSOLETE*
永远不会被返回的错误,用于旧的libcurl版本。
These error codes will never be returned. They were used in an old libcurl version and are currently unused.

猜你喜欢

转载自blog.csdn.net/ljl890705/article/details/78806037