CURL错误码

语言: CN / TW / HK

 There are a bunch of different error codes and their corresponding error messages that may appear during bad conditions. At the time of this writing, the exit codes are:

1

Unsupported protocol. This build of curl has no support for this protocol.

2

Failed to initialize.

3

URL malformed. The syntax was not correct.

4

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!

5

Couldn't resolve proxy. The given proxy host could not be resolved.

6

Couldn't resolve host. The given remote host was not resolved.

7

Failed to connect to host.

8

Weird server reply. The server sent data curl couldn't parse.

9

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 doesn't exist on the server.

10

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.

11

FTP weird PASS reply. Curl couldn't parse the reply sent to the PASS request.

12

During an active FTP session while waiting for the server to connect back to curl, the timeout expired.

13

FTP weird PASV reply, Curl couldn't parse the reply sent to the PASV request.

14

FTP weird 227 format. Curl couldn't parse the 227-line the server sent.

15

FTP can't get host. Couldn't resolve the host IP we got in the 227-line.

16

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.

17

FTP couldn't set binary. Couldn't change transfer method to binary.

18

Partial file. Only a part of the file was transferred.

19

FTP couldn't download/access the given file, the RETR (or similar) command failed.

21

FTP quote error. A quote command returned error from the server.

22

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 -f, --fail is used.

23

Write error. Curl couldn't write data to a local filesystem or similar.

25

FTP couldn't STOR file. The server denied the STOR operation, used for FTP uploading.

26

Read error. Various reading problems.

27

Out of memory. A memory allocation request failed.

28

Operation timeout. The specified time-out period was reached according to the conditions.

30

FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT command, try doing a transfer using PASV instead!

31

FTP couldn't use REST. The REST command failed. This command is used for resumed FTP transfers.

33

HTTP range error. The range "command" didn't work.

34

HTTP post error. Internal post-request generation error.

35

SSL connect error. The SSL handshaking failed.

36

Bad download resume. Couldn't continue an earlier aborted download.

37

FILE couldn't read file. Failed to open the file. Permissions?

38

LDAP cannot bind. LDAP bind operation failed.

39

LDAP search failed.

41

Function not found. A required LDAP function was not found.

42

Aborted by callback. An application told curl to abort the operation.

43

Internal error. A function was called with a bad parameter.

45

Interface error. A specified outgoing interface could not be used.

47

Too many redirects. When following redirects, curl hit the maximum amount.

48

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!

49

Malformed telnet option.

51

The peer's SSL certificate or SSH MD5 fingerprint was not OK.

52

The server didn't reply anything, which here is considered an error.

53

SSL crypto engine not found.

54

Cannot set SSL crypto engine as default.

55

Failed sending network data.

56

Failure in receiving network data.

58

Problem with the local certificate.

59

Couldn't use specified SSL cipher.

60

Peer certificate cannot be authenticated with known CA certificates.

61

Unrecognized transfer encoding.

62

Invalid LDAP URL.

63

Maximum file size exceeded.

64

Requested FTP SSL level failed.

65

Sending the data requires a rewind that failed.

66

Failed to initialise SSL Engine.

67

The user name, password, or similar was not accepted and curl failed to log in.

68

File not found on TFTP server.

69

Permission problem on TFTP server.

70

Out of disk space on TFTP server.

71

Illegal TFTP operation.

72

Unknown TFTP transfer ID.

73

File already exists (TFTP).

74

No such user (TFTP).

75

Character conversion failed.

76

Character conversion functions required.

77

Problem with reading the SSL CA cert (path? access rights?).

78

The resource referenced in the URL does not exist.

79

An unspecified error occurred during the SSH session.

80

Failed to shut down the SSL connection.

82

Could not load CRL file, missing or wrong format (added in 7.19.0).

83

Issuer check failed (added in 7.19.0).

84

The FTP PRET command failed

85

RTSP: mismatch of CSeq numbers

86

RTSP: mismatch of Session Identifiers

87

unable to parse FTP file list

88

FTP chunk callback reported error

89

No connection available, the session will be queued

90

SSL public key does not matched pinned public key

91

Invalid SSL certificate status.

92

Stream error in HTTP/2 framing layer.

93

An API function was called from inside a callback.

94

An authentication function returned an error.

95

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.

96

QUIC connection error. This error may be caused by an SSL library error. QUIC is the protocol used for HTTP/3 transfers.

XX

More error codes will appear here in future releases. The existing ones are meant to never change.

 

CURLE_OK(0)

所有罚款。继续像往常一样。

CURLE_UNSUPPORTED_PROTOCOL(1)

你的URL传递给libcurl的使用协议,这libcurl的不支持。支持可能是你没有使用一个编译时的选项,它可以是一个拼写错的协议字符串,或者只是一个协议的libcurl没有代码。

 

CURLE_FAILED_INIT(2)

非常早期的初始化代码失败。这可能是内部错误或问题,资源问题,一些基本的东西可能无法完成初始化时间。

CURLE_URL_MALFORMAT(3)

该网址的格式不正确。

CURLE_NOT_BUILT_IN(4)

libcurl的内置在​​一个编译时决定所要求的功能,协议或购股权没有被发现。这意味着,一个功能或选项是不启用或明确禁用的libcurl建时,为了得到它的功能,你必须得到一个重建的libcurl的。

CURLE_COULDNT_RESOLVE_PROXY(5)

无法解析代理服务器。代理主机无法得到解决。

CURLE_COULDNT_RESOLVE_HOST(6)

无法解析主机。给定的远程主机没有得到解决。

CURLE_COULDNT_CONNECT(7)

connect()的主机或代理失败。

CURLE_FTP_WEIRD_SERVER_REPLY(8)

连接到一个FTP服务器后,libcurl的预期得到一定的回复返回。这个错误代码表示,它有一个奇怪的或坏的答复。指定的远程服务器可能不是一个确定的FTP服务器。

CURLE_REMOTE_ACCESS_DENIED(9)

我们被拒绝访问的资源的URL。对于FTP,发生这种情况而力图改变的远程目录。

CURLE_FTP_ACCEPT_FAILED(10)

在等待服务器的连接时,一个主动FTP会话使用,被送到控制连接或类似的错误代码。

CURLE_FTP_WEIRD_PASS_REPLY(11)

发送到服务器的FTP密码后,libcurl的预计正确的答复。此错误代码指示返回了意外的代码。

CURLE_FTP_ACCEPT_TIMEOUT(12)

在当前的FTP会话在等待服务器连接,CURLOPT_ACCEPTTIMOUT_MS(或内部默认),超时过期。

CURLE_FTP_WEIRD_PASV_REPLY(13)

libcurl的失败作为一个PASV或EPSV命令从服务器得到一个合理的结果。服务器是有缺陷的。

CURLE_FTP_WEIRD_227_FORMAT(14)

FTP服务器返回一个227行作为一个PASV命令的响应。如果libcurl的无法解析该行,此返回代码被传递回。

CURLE_FTP_CANT_GET_HOST(15)

内部故障查找主机使用新的连接。

CURLE_FTP_COULDNT_SET_TYPE(17)

收到一个错误,当试图传送模式设置为二进制或ASCII。

CURLE_PARTIAL_FILE(18)

文件传输,短于或大于预期。发生这种情况时,服务器首先报告预期的传输大小,然后提供数据不匹配前面给出的大小。

CURLE_FTP_COULDNT_RETR_FILE(19)

这是一个奇怪的回答“RETR”命令或一个零字节传输完成。

CURLE_QUOTE_ERROR(21)

当发送到远程服务器,自定义的“QUOTE”命令的一个命令返回的错误代码为400或更高(对于FTP)或表示不成功的完成命令。

CURLE_HTTP_RETURNED_ERROR(22)

这是返回CURLOPT_FAILONERROR设置为TRUE和HTTP服务器返回的错误代码是> = 400。

CURLE_WRITE_ERROR(23)

发生错误,写作时接收到的数据到本地文件,或者返回错误libcurl的一个写回调。

CURLE_UPLOAD_FAILED(25)

开始上载失败。对于FTP,服务器通常否认的STOR命令。通常的错误缓冲区包含了服务器的解释。

CURLE_READ_ERROR(26)

有一个问题读取本地文件或返回一个错误的读回调。

CURLE_OUT_OF_MEMORY(27)

内存分配请求失败。这是严重的不良和活动,如果发生过严重搞砸了。

CURLE_OPERATION_TIMEDOUT(28)

操作超时。根据条件达到指定的超时期间。

CURLE_FTP_PORT_FAILED(30)

FTP PORT命令返回错误。这主要是当你还没有足够的地址指定了一个良好的libcurl的使用。SeeCURLOPT_FTPPORT。

CURLE_FTP_COULDNT_USE_REST(31)

FTP REST命令返回错误。如果服务器是明智的,这不应该发生。

CURLE_RANGE_ERROR(33)

服务器不支持或接受范围请求。

CURLE_HTTP_POST_ERROR(34)

这是一个奇怪的错误,主要发生是由于内部的混乱。

CURLE_SSL_CONNECT_ERROR(35)

出现问题的地方,在SSL / TLS握手。你真正想要的的错误缓冲区和阅读邮件,因为它针对问题稍微。可能是证书(文件格式,路径,权限),密码,和其他人。

CURLE_BAD_DOWNLOAD_RESUME(36)

下载无法恢复,因为指定的偏移量为文件的边界。

CURLE_FILE_COULDNT_READ_FILE(37)

无法打开的文件FILE :/ /。最有可能的,因为该文件的路径不能识别现有文件。你是否检查文件的权限?

CURLE_LDAP_CANNOT_BIND(38)

LDAP无法绑定。LDAP绑定操作失败。

CURLE_LDAP_SEARCH_FAILED(39)

LDAP搜索失败。

CURLE_FUNCTION_NOT_FOUND(41)

函数没有找到。一个必需的zlib的功能没有被发现。

CURLE_ABORTED_BY_CALLBACK(42)

通过回调中止。返回的回调“中止”libcurl的。

CURLE_BAD_FUNCTION_ARGUMENT(43)

内部错误。函数调用了一个错误的参数。

CURLE_INTERFACE_FAILED(45)

接口错误。指定的出接口不能使用。设置接口使用传出连接的源IP地址与CURLOPT_INTERFACE。

CURLE_TOO_MANY_REDIRECTS(47)

过多的重定向。以下重定向时,libcurl的创下的最高金额。设置您的与CURLOPT_MAXREDIRS限制。

CURLE_UNKNOWN_OPTION(48)

无法识别的选项传递给libcurl的/。请参阅相应的文档。这是最有可能在程序中使用libcurl的问题。的的错误缓冲区可能包含准确的选项,它涉及更具体的信息。

CURLE_TELNET_OPTION_SYNTAX(49)

telnet选项字符串被非法格式化。

CURLE_PEER_FAILED_VERIFICATION(51)

远程服务器的SSL证书或SSH的MD5指纹被认为是不正常的。

CURLE_GOT_NOTHING(52)

没有从服务器返回的,和得到什么的情况下,被认为是一个错误。

CURLE_SSL_ENGINE_NOTFOUND(53)

未找到指定的加密引擎。

CURLE_SSL_ENGINE_SETFAILED(54)

设置所选的SSL加密引擎,默认情况下失败!

CURLE_SEND_ERROR(55)

发送网络数据失败。

CURLE_RECV_ERROR(56)

如果接收网络数据。

CURLE_SSL_CERTPROBLEM(58)

与当地的客户端证书的问题。

CURLE_SSL_CIPHER(59)

无法使用指定的密码。

CURLE_SSL_CACERT(60)

同侪凭证不能与已知的CA证书进行身份验证。

CURLE_BAD_CONTENT_ENCODING(61)

无法识别的传输编码。

CURLE_LDAP_INVALID_URL(62)

无效的LDAP URL。

CURLE_FILESIZE_EXCEEDED(63)

最大文件大小超过。

CURLE_USE_SSL_FAILED(64)

要求FTP SSL水平失败。

CURLE_SEND_FAIL_REWIND(65)

在做了一个发送操作卷曲,倒带重传的数据,但的倒带操作失败。

CURLE_SSL_ENGINE_INITFAILED(66)

SSL发动机启动失败。

CURLE_LOGIN_DENIED(67)

远程服务器拒绝卷曲登录(加入7.13.1)

CURLE_TFTP_NOTFOUND(68)

TFTP服务器上找不到文件。

CURLE_TFTP_PERM(69)

TFTP服务器上的权限问题。

CURLE_REMOTE_DISK_FULL(70)

出在服务器上的磁盘空间。

CURLE_TFTP_ILLEGAL(71)

非法的TFTP操作。

CURLE_TFTP_UNKNOWNID(72)

未知TFTP传输ID。

CURLE_REMOTE_FILE_EXISTS(73)

文件已经存在,并不会被覆盖。

CURLE_TFTP_NOSUCHUSER(74)

这个错误不应该被返回正常工作的TFTP服务器。

CURLE_CONV_FAILED(75)

字符转换失败。

CURLE_CONV_REQD(76)

调用者必须注册转换回调。

CURLE_SSL_CACERT_BADFILE(77)

问题读取SSL证书(路径的访问权限?)

CURLE_REMOTE_FILE_NOT_FOUND(78)

不存在的URL引用的资源。

CURLE_SSH(79)

未指定的错误发生在SSH会话。

CURLE_SSL_SHUTDOWN_FAILED(80)

关闭SSL连接失败。

CURLE_AGAIN(81)

Socket是没有准备好发送/接收等待,直到它准备好了,然后再试一次。此返回代码仅返回从 curl_easy_recv(3)  和  (3) 加入7.18.2 curl_easy_send),

CURLE_SSL_CRL_BADFILE(82)

无法加载CRL文件(在7.19.0版加入)

CURLE_SSL_ISSUER_ERROR(83)

发行人检查失败(在7.19.0版加入)

CURLE_FTP_PRET_FAILED(84)

FTP服务器不理解的PRET命令,所有不支持给定的参数。要小心时usingCURLOPT_CUSTOMREQUEST,自定义列表“命令将发送PRET CMD前PASV以及。(添加在7.20.0)

CURLE_RTSP_CSEQ_ERROR(85)

RTSP的Cseq号码不匹配。

CURLE_RTSP_SESSION_ERROR(86)

RTSP会话标识符不匹配。

CURLE_FTP_BAD_FILE_LIST(87)

无法,解析FTP文件列表(在FTP通配符下载)。

CURLE_CHUNK_FAILED(88)

块回调报告错误。

CURLE_OBSOLETE *

这些错误代码永远不会返回。它们被用来在一个老的libcurl版本,当前未使用。 

分享到: