說明:
curl常見的返回錯誤碼,中文的翻譯好像不是很詳細,因此把英文的貼在下面了。有空再翻譯下。
中文:
CURLE_OK (0) – 都正確,像往常一樣 CURLE_UNSUPPORTED_PROTOCOL (1) – 您傳送給 libcurl 的網(wǎng)址使用了此 libcurl 不支持的協(xié)議。 可能是您沒有使用的編譯時選項造成了這種情況(可能是協(xié)議字符串拼寫有誤,或沒有指定協(xié)議 libcurl 代碼)。 CURLE_FAILED_INIT (2) – 非常早期的初始化代碼失敗。 可能是內(nèi)部錯誤或問題。 CURLE_URL_MALFORMAT (3) – 網(wǎng)址格式不正確。 CURLE_COULDNT_RESOLVE_PROXY (5) – 無法解析代理服務(wù)器。 指定的代理服務(wù)器主機無法解析。 CURLE_COULDNT_RESOLVE_HOST (6) – 無法解析主機。 指定的遠程主機無法解析。 CURLE_COULDNT_CONNECT (7) – 無法通過 connect() 連接至主機或代理服務(wù)器。 CURLE_FTP_WEIRD_SERVER_REPLY (8) – 在連接到 FTP 服務(wù)器后,libcurl 需要收到特定的回復。 此錯誤代碼表示收到了不正常或不正確的回復。 指定的遠程服務(wù)器可能不是正確的 FTP 服務(wù)器。 CURLE_REMOTE_ACCESS_DENIED (9) – 我們無法訪問網(wǎng)址中指定的資源。 對于 FTP,如果嘗試更改為遠程目錄,就會發(fā)生這種情況。 CURLE_FTP_WEIRD_PASS_REPLY (11) – 在將 FTP 密碼發(fā)送到服務(wù)器后,libcurl 需要收到正確的回復。 此錯誤代碼表示返回的是意外的代碼。 CURLE_FTP_WEIRD_PASV_REPLY (13) – libcurl 無法從服務(wù)器端收到有用的結(jié)果,作為對 PASV 或 EPSV 命令的響應(yīng)。 服務(wù)器有問題。 CURLE_FTP_WEIRD_227_FORMAT (14) – FTP 服務(wù)器返回 227 行作為對 PASV 命令的響應(yīng)。 如果 libcurl 無法解析此行,就會返回此代碼。 CURLE_FTP_CANT_GET_HOST (15) – 在查找用于新連接的主機時出現(xiàn)內(nèi)部錯誤。 CURLE_FTP_COULDNT_SET_TYPE (17) – 在嘗試將傳輸模式設(shè)置為二進制或 ascii 時發(fā)生錯誤。 CURLE_PARTIAL_FILE (18) – 文件傳輸尺寸小于或大于預期。 當服務(wù)器先報告了一個預期的傳輸尺寸,然后所傳送的數(shù)據(jù)與先前指定尺寸不相符時,就會發(fā)生此錯誤。 CURLE_FTP_COULDNT_RETR_FILE (19) – ‘RETR’ 命令收到了不正常的回復,或完成的傳輸尺寸為零字節(jié)。 CURLE_QUOTE_ERROR (21) – 在向遠程服務(wù)器發(fā)送自定義 “QUOTE” 命令時,其中一個命令返回的錯誤代碼為 400 或更大的數(shù)字(對于 FTP),或以其他方式表明命令無法成功完成。 CURLE_HTTP_RETURNED_ERROR (22) – 如果 CURLOPT_FAILONERROR 設(shè)置為 TRUE,且 HTTP 服務(wù)器返回 >= 400 的錯誤代碼,就會返回此代碼。 (此錯誤代碼以前又稱為 CURLE_HTTP_NOT_FOUND。) CURLE_WRITE_ERROR (23) – 在向本地文件寫入所收到的數(shù)據(jù)時發(fā)生錯誤,或由寫入回調(diào) (write callback) 向 libcurl 返回了一個錯誤。 CURLE_UPLOAD_FAILED (25) – 無法開始上傳。 對于 FTP,服務(wù)器通常會拒絕執(zhí)行 STOR 命令。 錯誤緩沖區(qū)通常會提供服務(wù)器對此問題的說明。 (此錯誤代碼以前又稱為 CURLE_FTP_COULDNT_STOR_FILE。) CURLE_READ_ERROR (26) – 讀取本地文件時遇到問題,或由讀取回調(diào) (read callback) 返回了一個錯誤。 CURLE_OUT_OF_MEMORY (27) – 內(nèi)存分配請求失敗。 此錯誤比較嚴重,若發(fā)生此錯誤,則表明出現(xiàn)了非常嚴重的問題。 CURLE_OPERATION_TIMEDOUT (28) – 操作超時。 已達到根據(jù)相應(yīng)情況指定的超時時間。 請注意: 自 Urchin 6.6.0.2 開始,超時時間可以自行更改。 要指定遠程日志下載超時,請打開 urchin.conf 文件,取消以下行的注釋標記:
CURLE_FTP_PORT_FAILED (30) – FTP PORT 命令返回錯誤。 在沒有為 libcurl 指定適當?shù)牡刂肥褂脮r,最有可能發(fā)生此問題。 請參閱 CURLOPT_FTPPORT。 CURLE_FTP_COULDNT_USE_REST (31) – FTP REST 命令返回錯誤。 如果服務(wù)器正常,則應(yīng)當不會發(fā)生這種情況。 CURLE_RANGE_ERROR (33) – 服務(wù)器不支持或不接受范圍請求。 CURLE_HTTP_POST_ERROR (34) – 此問題比較少見,主要由內(nèi)部混亂引發(fā)。 CURLE_SSL_CONNECT_ERROR (35) – 同時使用 SSL/TLS 時可能會發(fā)生此錯誤。 您可以訪問錯誤緩沖區(qū)查看相應(yīng)信息,其中會對此問題進行更詳細的介紹。 可能是證書(文件格式、路徑、許可)、密碼及其他因素導致了此問題。 CURLE_FTP_BAD_DOWNLOAD_RESUME (36) – 嘗試恢復超過文件大小限制的 FTP 連接。 CURLE_FILE_COULDNT_READ_FILE (37) – 無法打開 FILE:// 路徑下的文件。 原因很可能是文件路徑無法識別現(xiàn)有文件。 建議您檢查文件的訪問權(quán)限。 CURLE_LDAP_CANNOT_BIND (38) – LDAP 無法綁定。LDAP 綁定操作失敗。 CURLE_LDAP_SEARCH_FAILED (39) – LDAP 搜索無法進行。 CURLE_FUNCTION_NOT_FOUND (41) – 找不到函數(shù)。 找不到必要的 zlib 函數(shù)。 CURLE_ABORTED_BY_CALLBACK (42) – 由回調(diào)中止。 回調(diào)向 libcurl 返回了 “abort”。 CURLE_BAD_FUNCTION_ARGUMENT (43) – 內(nèi)部錯誤。 使用了不正確的參數(shù)調(diào)用函數(shù)。 CURLE_INTERFACE_FAILED (45) – 界面錯誤。 指定的外部界面無法使用。 請通過 CURLOPT_INTERFACE 設(shè)置要使用哪個界面來處理外部連接的來源 IP 地址。 (此錯誤代碼以前又稱為 CURLE_HTTP_PORT_FAILED。) CURLE_TOO_MANY_REDIRECTS (47) – 重定向過多。 進行重定向時,libcurl 達到了網(wǎng)頁點擊上限。 請使用 CURLOPT_MAXREDIRS 設(shè)置上限。 CURLE_UNKNOWN_TELNET_OPTION (48) – 無法識別以 CURLOPT_TELNETOPTIONS 設(shè)置的選項。 請參閱相關(guān)文檔。 CURLE_TELNET_OPTION_SYNTAX (49) – telnet 選項字符串的格式不正確。 CURLE_PEER_FAILED_VERIFICATION (51) – 遠程服務(wù)器的 SSL 證書或 SSH md5 指紋不正確。 CURLE_GOT_NOTHING (52) – 服務(wù)器未返回任何數(shù)據(jù),在相應(yīng)情況下,未返回任何數(shù)據(jù)就屬于出現(xiàn)錯誤。 CURLE_SSL_ENGINE_NOTFOUND (53) – 找不到指定的加密引擎。 CURLE_SSL_ENGINE_SETFAILED (54) – 無法將選定的 SSL 加密引擎設(shè)為默認選項。 CURLE_SEND_ERROR (55) – 無法發(fā)送網(wǎng)絡(luò)數(shù)據(jù)。 CURLE_RECV_ERROR (56) – 接收網(wǎng)絡(luò)數(shù)據(jù)失敗。 CURLE_SSL_CERTPROBLEM (58) – 本地客戶端證書有問題 CURLE_SSL_CIPHER (59) – 無法使用指定的密鑰 CURLE_SSL_CACERT (60) – 無法使用已知的 CA 證書驗證對等證書 CURLE_BAD_CONTENT_ENCODING (61) – 無法識別傳輸編碼 CURLE_LDAP_INVALID_URL (62) – LDAP 網(wǎng)址無效 CURLE_FILESIZE_EXCEEDED (63) – 超過了文件大小上限 CURLE_USE_SSL_FAILED (64) – 請求的 FTP SSL 級別失敗 CURLE_SEND_FAIL_REWIND (65) – 進行發(fā)送操作時,curl 必須回轉(zhuǎn)數(shù)據(jù)以便重新傳輸,但回轉(zhuǎn)操作未能成功 CURLE_SSL_ENGINE_INITFAILED (66) – SSL 引擎初始化失敗 CURLE_LOGIN_DENIED (67) – 遠程服務(wù)器拒絕 curl 登錄(7.13.1 新增功能) CURLE_TFTP_NOTFOUND (68) – 在 TFTP 服務(wù)器上找不到文件 CURLE_TFTP_PERM (69) – 在 TFTP 服務(wù)器上遇到權(quán)限問題 CURLE_REMOTE_DISK_FULL (70) – 服務(wù)器磁盤空間不足 CURLE_TFTP_ILLEGAL (71) – TFTP 操作非法 CURLE_TFTP_UNKNOWNID (72) – TFTP 傳輸 ID 未知 CURLE_REMOTE_FILE_EXISTS (73) – 文件已存在,無法覆蓋 CURLE_TFTP_NOSUCHUSER (74) – 運行正常的 TFTP 服務(wù)器不會返回此錯誤 CURLE_CONV_FAILED (75) – 字符轉(zhuǎn)換失敗 CURLE_CONV_REQD (76) – 調(diào)用方必須注冊轉(zhuǎn)換回調(diào) CURLE_SSL_CACERT_BADFILE (77) – 讀取 SSL CA 證書時遇到問題(可能是路徑錯誤或訪問權(quán)限問題) CURLE_REMOTE_FILE_NOT_FOUND (78) – 網(wǎng)址中引用的資源不存在 CURLE_SSH (79) – SSH 會話中發(fā)生無法識別的錯誤 CURLE_SSL_SHUTDOWN_FAILED (80) – 無法終止 SSL 連接
英文:
Almost all “easy” interface functions return a CURLcode error code. No matter what, using the curl_easy_setopt option CURLOPT_ERRORBUFFER is a good idea as it will give you a human readable error string that may offer more details about the cause of the error than just the error code. curl_easy_strerror can be called to get an error string from a given CURLcode number. CURLcode is one of the following: 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) 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) After connecting to a FTP server, libcurl expects to get a certain reply back. This error code implies that it got a strange or bad reply. The given remote server is probably not an OK FTP server. CURLE_REMOTE_ACCESS_DENIED (9) 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) 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) 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 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) 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) 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) 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) This was either a weird reply to a ‘RETR’ command or a zero byte transfer complete. CURLE_QUOTE_ERROR (21) 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) 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) 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) The FTP REST command returned error. This should never happen if the server is sane. CURLE_RANGE_ERROR (33) 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) 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 cannot bind. LDAP bind operation failed. CURLE_LDAP_SEARCH_FAILED (39) LDAP search failed. CURLE_FUNCTION_NOT_FOUND (41) 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) 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) A telnet option string was Illegally formatted. CURLE_PEER_FAILED_VERIFICATION (51) 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) The specified crypto engine wasn’t found. CURLE_SSL_ENGINE_SETFAILED (54) 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) Couldn’t use specified cipher. CURLE_SSL_CACERT (60) Peer certificate cannot be authenticated with known CA certificates. CURLE_BAD_CONTENT_ENCODING (61) Unrecognized transfer encoding. CURLE_LDAP_INVALID_URL (62) Invalid LDAP URL. CURLE_FILESIZE_EXCEEDED (63) Maximum file size exceeded. CURLE_USE_SSL_FAILED (64) 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) 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) File not found on TFTP server. CURLE_TFTP_PERM (69) Permission problem on TFTP server. CURLE_REMOTE_DISK_FULL (70) Out of disk space on the server. CURLE_TFTP_ILLEGAL (71) Illegal TFTP operation. CURLE_TFTP_UNKNOWNID (72) Unknown TFTP transfer ID. CURLE_REMOTE_FILE_EXISTS (73) File already exists and will not be overwritten. CURLE_TFTP_NOSUCHUSER (74) 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) Problem with reading the SSL CA cert (path? access rights?) CURLE_REMOTE_FILE_NOT_FOUND (78) The resource referenced in the URL does not exist. CURLE_SSH (79) An unspecified error occurred during the SSH session. CURLE_SSL_SHUTDOWN_FAILED (80) Failed to shut down the SSL connection. CURLE_AGAIN (81) 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) 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) 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) Mismatch of RTSP CSeq numbers. CURLE_RTSP_SESSION_ERROR (86) Mismatch of RTSP Session Identifiers. CURLE_FTP_BAD_FILE_LIST (87) Unable to parse FTP file list (during FTP wildcard downloading). CURLE_CHUNK_FAILED (88) Chunk callback reported error. CURLE_NO_CONNECTION_AVAILABLE (89) (For internal use only, will never be returned by libcurl) No connection available, the session will be queued. (added in 7.30.0) CURLE_OBSOLETE* These error codes will never be returned. They were used in an old libcurl version and are currently unused.
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com