There are a bunch of different error codes and their corresponding error messages that may appear under error conditions. At the time of this writing, the exit codes are:
Success. The operation completed successfully according to the instructions.
Unsupported protocol. This build of curl has no support for this protocol.
Failed to initialize.
URL malformed. The syntax was not correct.
A feature or option that was needed to perform the desired request was not enabled or was explicitly disabled at build-time. To make curl able to do this, you probably need another build of libcurl.
Could not resolve proxy. The given proxy host could not be resolved.
Could not resolve host. The given remote host could not be resolved.
Failed to connect to host.
Weird server reply. The server sent data curl could not parse.
FTP access denied. The server denied login or denied access to the particular resource or directory you wanted to reach. Most often you tried to change to a directory that does not exist on the server.
FTP accept failed. 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.
FTP weird PASS reply. Curl could not parse the reply sent to the PASS request.
During an active FTP session while waiting for the server to connect back to curl, the timeout expired.
FTP weird PASV reply, Curl could not parse the reply sent to the PASV request.
FTP weird 227 format. Curl could not parse the 227-line the server sent.
FTP cannot use host. Could not resolve the host IP we got in the 227-line.
HTTP/2 error. A problem was detected in the HTTP2 framing layer. This is somewhat generic and can be one out of several problems, see the error message for details.
FTP could not set binary. Could not change transfer method to binary.
Partial file. Only a part of the file was transferred.
FTP could not download/access the given file, the RETR (or similar) command failed.
FTP quote error. A quote command returned error from the server.
HTTP page not retrieved. The requested URL was not found or returned another error with the HTTP error code being 400 or above. This return code only appears if --fail is used.
Write error. Curl could not write data to a local filesystem or similar.
Failed starting the upload. For FTP, the server typically denied the STOR command.
Read error. Various reading problems.
Out of memory. A memory allocation request failed.
Operation timeout. The specified time-out period was reached according to the conditions.
FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT command, try doing a transfer using PASV instead.
FTP could not use REST. The REST command failed. This command is used for resumed FTP transfers.
HTTP range error. The range "command" did not work.
HTTP post error. Internal post-request generation error.
SSL connect error. The SSL handshaking failed.
Bad download resume. Could not continue an earlier aborted download.
FILE could not read file. Failed to open the file. Permissions?
LDAP cannot bind. LDAP bind operation failed.
LDAP search failed.
Function not found. A required LDAP function was not found.
Aborted by callback. An application told curl to abort the operation.
Internal error. A function was called with a bad parameter.
Interface error. A specified outgoing interface could not be used.
Too many redirects. When following redirects, curl hit the maximum amount.
Unknown option specified to libcurl. This indicates that you passed a weird option to curl that was passed on to libcurl and rejected. Read up in the manual!
Malformed telnet option.
The server did not reply anything, which here is considered an error.
SSL crypto engine not found.
Cannot set SSL crypto engine as default.
Failed sending network data.
Failure in receiving network data.
Problem with the local certificate.
Could not use specified SSL cipher.
Peer certificate cannot be authenticated with known CA certificates.
Unrecognized transfer encoding.
Maximum file size exceeded.
Requested FTP SSL level failed.
Sending the data requires a rewind that failed.
Failed to initialize SSL Engine.
The username, password, or similar was not accepted and curl failed to log in.
File not found on TFTP server.
Permission problem on TFTP server.
Out of disk space on TFTP server.
Illegal TFTP operation.
Unknown TFTP transfer ID.
File already exists (TFTP).
No such user (TFTP).
Problem reading the SSL CA cert (path? access rights?).
The resource referenced in the URL does not exist.
An unspecified error occurred during the SSH session.
Failed to shut down the SSL connection.
Could not load CRL file, missing or wrong format (added in 7.19.0).
Issuer check failed (added in 7.19.0).
The FTP PRET command failed.
Mismatch of RTSP CSeq numbers.
Mismatch of RTSP Session Identifiers.
Unable to parse FTP file list.
FTP chunk callback reported error.
No connection available, the session is queued.
SSL public key does not matched pinned public key.
Invalid SSL certificate status.
Stream error in HTTP/2 framing layer.
An API function was called from inside a callback.
An authentication function returned an error.
A problem was detected in the HTTP/3 layer. This is somewhat generic and can be one out of several problems, see the error message for details.
QUIC connection error. This error may be caused by an SSL library error. QUIC is the protocol used for HTTP/3 transfers.
Proxy handshake error.
A client-side certificate is required to complete the TLS handshake.
Poll or select returned fatal error.
A value or data field grew larger than allowed.
More error codes might appear here in future releases. The existing ones are meant to never change.