[Translate]libcurl error code

Source: Internet
Author: User
Tags ftp file ldap rewind ssl certificate ssl connection

Curlcode

Almost all ' easy ' interface functions return a curlcode error code. No matter what, using the curl_easy_setopt option Curlopt_errorbuffer was a good idea as it would give you a human readable Error string that could offer more details about the cause of the error than just the error code. Curl_easy_strerror can is called to get the error string from a given curlcode number.
Almost all easy interface functions return an error code of type Curlcode.
In any case, use curl_easy_setopt (handle, Curlopt_errorbuffer) to get a human-readable error reason string,
Is better than just getting an error code.
The Curl_easy_strerror function can get the error reason string through Error_code.

Curlcode is one of the following:
The Curlcode error code is as follows:

CURLE_OK (0)
All fine. Proceed as usual.
Normal

Curle_unsupported_protocol (1)
The URL is passed to Libcurl used a protocol, that is libcurl does not support. The support might is a compile-time option that is didn ' t use, it can be a misspelled protocol string or just a protocol Libcurl have no code for.
Protocol not supported

Curle_failed_init (2)
Very early initialization code failed. This was likely to being an internal error or problem, or a resource problem where something fundamental couldn ' t get do at Init time.
Initialization failed

Curle_url_malformat (3)
The URL is not properly formatted.
URL not formatted

Curle_not_built_in (4)
A requested feature, protocol or option is not found built-in in the Libcurl due to a build-time decision. This means a feature or option is not enabled or explicitly disabled when Libcurl is built and in order to get it T o function you has to get a rebuilt libcurl.
attribute, OPTION, protocol not recognized

Curle_couldnt_resolve_proxy (5)
Couldn ' t resolve proxy. The given proxy host could not be resolved.
Agent cannot parse

Curle_couldnt_resolve_host (6)
Couldn ' t resolve host. The given remote host is not resolved.
Host cannot parse

Curle_couldnt_connect (7)
Failed to connect () to host or proxy.
Host or agent cannot connect

Curle_ftp_weird_server_reply (8)
After connecting to a FTP server, Libcurl expects to get a certain reply back. This error code implies the it got a strange or bad reply. The given remote server is probably a 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 the remote directory.
Remote resource denied access

Curle_ftp_accept_failed (10)
While waiting for the server to connect back when a active FTP session is used, a error code was sent over the control C Onnection or similar.

Curle_ftp_weird_pass_reply (11)
After have sent the FTP password to the server, Libcurl expects a proper reply. This error code indicates, unexpected code was returned.

Curle_ftp_accept_timeout (12)
During an active FTP session while waiting for the server to connect, the Curlopt_accepttimout_ms (3) (or the internal DEFA ULT) 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 the parse that line, this return code was 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 is detected in the HTTP2 framing layer. This is somewhat generic and can being one out of several problems, see the error buffer for details.
HTTP2 a problem in the frame layer, you can view the details by using the error buffer

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 a expected transfer size, and then delivers data that doesn ' t match the Previo usly given size.
File transfer length exception.
The length of the file actually obtained does not match the length of the server's first description file.

Curle_ftp_couldnt_retr_file (19)
This is 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 a error code that is a or high ER (for FTP) or otherwise indicated unsuccessful completion of the command.
When the quote command is sent to the remote server, the server returns an error code of 400 or greater.

Curle_http_returned_error (22)
This is returned if Curlopt_failonerror are set TRUE and the HTTP server returns an error code which is >= 400.
If the Curlopt_failonerror property is set to True, and the server returns the HTTP Code >= 400

Curle_write_error (23)
An error occurred if writing received data to a local file, or an error is returned to Libcurl from a write callback.
Write local file or write callback error

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.
Upload failed

Curle_read_error (26)
There is a problem reading a local file or an error returned by the read callback.
Read local file or read callback error

Curle_out_of_memory (27)
A memory allocation request failed. This is serious badness and things be severely screwed up if this ever occurs.
Memory allocation failure

Curle_operation_timedout (28)
Operation Timeout. The specified time-out period was reached according to the conditions.
The operation timed out.

Curle_ftp_port_failed (30)
The FTP PORT command returned error. This mostly happens if you haven ' t specified a good the 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 a support or accept range requests.
The server does not support or accept range mode

Curle_http_post_error (34)
This is an odd error, mainly occurs due to internal confusion.
Post error

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.
SSL connection Error

Curle_bad_download_resume (36)
The download could not being resumed because the specified offset is out of the file boundary.
The download cannot be restored because the specified offset exceeds the file size

Curle_file_couldnt_read_file (37)
A file given with file://couldn ' t is opened. Most likely because the file path doesn ' t identify an existing file. Did you check file permissions?
File does not exist, or permissions are incorrect


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 is not found.

Curle_aborted_by_callback (42)
Aborted by callback. A callback returned "abort" to Libcurl.
Callback Error

Curle_bad_function_argument (43)
Internal error. A function is called with a bad parameter.
Error in function call parameter

Curle_interface_failed (45)
Interface error. A specified outgoing interface could not being used. Set which interface to use for outgoing connections ' source IP address with curlopt_interface.
Interface error, the specified external interface could not be called.

Curle_too_many_redirects (47)
Too many redirects. When following redirects, Libcurl hits the maximum amount. Set your limit with curlopt_maxredirs.
Too many redirects. The maximum number of hops is reached when the redirect is automatically followed.
You can set the number of redirects through Curlopt_maxredirs.

Curle_unknown_option (48)
An option passed to Libcurl are not recognized/known. Refer to the appropriate documentation. This is likely a problem in the program that uses Libcurl. The error buffer might contain more specific information about which exact option it concerns.
option is not recognized.

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 is deemed not OK.

Curle_got_nothing (52)
Nothing was returned from the server, and under the circumstances, getting nothing is considered an error.
The server didn't return anything.

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.
Failed to send data

Curle_recv_error (56)
Failure with receiving network data.
Failed to accept 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 is authenticated with known CA certificates.

Curle_bad_content_encoding (61)
Unrecognized transfer encoding.
Transmission encoding not recognized

Curle_ldap_invalid_url (62)
Invalid LDAP URL.

Curle_filesize_exceeded (63)
Maximum file size exceeded.
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.
Rewind 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 is not being overwritten.

Curle_tftp_nosuchuser (74)
This error should never is 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 is 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 a ready for send/recv wait till it's ready and try again. This return code was only returned from Curl_easy_recv and Curl_easy_send (Added in 7.18.2)
The socket is not ready for read and write operations.
Only Curl_easy_recv and Curl_easy_send will return this error.

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 would 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.
Chunk Callback Error

Curle_no_connection_available (89)
(For internal with only, 'll never be returned by Libcurl) No connection available, the session would be queued. (added in 7.30.0)

curle_obsolete*
These error codes would never be returned. They were used in a old Libcurl version and is currently unused.

Curlmcode
The generic return code used by functions in the Libcurl multi interface. Also consider Curl_multi_strerror.
Multi interface Return

Curlm_call_multi_perform (-1)
This isn't really an error. It means should call Curl_multi_perform again without doing select () or similar in between. Before version 7.20.0 this could being returned by Curl_multi_perform, but in later versions this return code is never used.
It's not a mistake. This means you can call Curl_multi_perform again without having to do things like select.
Curl_multi_perform will return before the 7.20.0 version and will no longer be used in subsequent versions.

CURLM_OK (0)
Things is fine.
Everything's fine.

Curlm_bad_handle (1)
The passed-in handle is not a valid CURLM handle.
The incoming mutli handle is invalid.

Curlm_bad_easy_handle (2)
An easy handle is not good/valid. It could mean that it isn ' t a easy handle at all, or possibly that the handle already are in used by this or another multi Handle.
Easy handle is invalid.
Maybe this is not an easy handle, or this easy handle already exists with this multi handle or other multi handle.

Curlm_out_of_memory (3)
You are doomed.
You're done.

Curlm_internal_error (4)
This can is only returned if Libcurl bugs. Us! it to
Internal Error

Curlm_bad_socket (5)
The passed-in socket is a valid one, Libcurl already knows about. (Added in 7.15.4)
The incoming socket is invalid.

Curlm_unknown_option (6)
Curl_multi_setopt () with unsupported option (Added in 7.15.4)
Curl_multi_setopt does not support this option.

Curlm_added_already (7)
An easy handle already added to a multi handle is attempted to get added a second time. (Added in 7.32.1)
Easy handle already exists in multi handle and cannot be added

Curlshcode
The "Share" interface would return a curlshcode to indicate if an error had occurred. Also consider Curl_share_strerror.


CURLSHE_OK (0)
All fine. Proceed as usual.

Curlshe_bad_option (1)
An invalid option is passed to the function.

Curlshe_in_use (2)
The Share object is currently on use.

Curlshe_invalid (3)
An invalid share object is passed to the function.

Curlshe_nomem (4)
Not enough memory is available. (Added in 7.12.0)

Curlshe_not_built_in (5)
The requested sharing could not being done because the library your use don ' t has that particular feature enabled. (Added in 7.23.0)

[Translate]libcurl error code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.