added curl_*_strerror
[platform/upstream/curl.git] / docs / libcurl / libcurl-errors.3
1 .\" You can view this file with:
2 .\" nroff -man [file]
3 .\" $Id$
4 .\"
5 .TH libcurl-errors 3 "27 Apr 2004" "libcurl 7.12" "libcurl errors"
6 .SH NAME
7 libcurl-errors \- error codes in libcurl
8 .SH DESCRIPTION
9 This man page includes most, if not all, available error codes in libcurl.
10 Why they occur and possibly what you can do to fix the problem.
11 .SH "CURLcode"
12 Almost all "easy" interface functions return a CURLcode error code. No matter
13 what, using the \fIcurl_easy_setopt(3)\fP option \fICURLOPT_ERRORBUFFER\fP is
14 a good idea as it will give you a human readable error string that may offer
15 more details about the error cause than just the error code
16 does. \fIcurl_easy_strerror(3)\fP can be called to get an error string from a
17 given CURLcode number.
18
19 CURLcode is one of the following:
20 .IP "CURLE_OK (0)"
21 All fine. Proceed as usual.
22 .IP "CURLE_UNSUPPORTED_PROTOCOL (1)"
23 The URL you passed to libcurl used a protocol that this libcurl does not
24 support. The support might be a compile-time option that you didn't use, it
25 can be a misspelled protocol string or just a protocol libcurl has no code
26 for.
27 .IP "CURLE_FAILED_INIT (2)"
28 Very early initialization code failed. This is likely to be an internal error
29 or problem.
30 .IP "CURLE_URL_MALFORMAT (3)"
31 The URL was not properly formatted.
32 .IP "CURLE_URL_MALFORMAT_USER (4)"
33 URL user malformatted. The user-part of the URL syntax was not correct.
34 .IP "CURLE_COULDNT_RESOLVE_PROXY (5)"
35 Couldn't resolve proxy. The given proxy host could not be resolved.
36 .IP "CURLE_COULDNT_RESOLVE_HOST (6)"
37 Couldn't resolve host. The given remote host was not resolved.
38 .IP "CURLE_COULDNT_CONNECT (7)"
39 Failed to connect() to host or proxy.
40 .IP "CURLE_FTP_WEIRD_SERVER_REPLY (8)"
41 After connecting to an FTP server, libcurl expects to get a certain reply back.
42 This error code implies that it god a strange or bad reply. The given remote
43 server is probably not an OK FTP server.
44 .IP "CURLE_FTP_ACCESS_DENIED (9)"
45 We were denied access when trying to login to an FTP server or when trying to
46 change working directory to the one given in the URL.
47 .IP "CURLE_FTP_USER_PASSWORD_INCORRECT (10)"
48 The username and/or the password were incorrect when trying to login to an FTP
49 server.
50 .IP "CURLE_FTP_WEIRD_PASS_REPLY (11)"
51 After having sent the FTP password to the server, libcurl expects a proper
52 reply. This error code indicates that an unexpected code was returned.
53 .IP "CURLE_FTP_WEIRD_USER_REPLY (12)"
54 After having sent user name to the FTP server, libcurl expects a proper
55 reply. This error code indicates that an unexpected code was returned.
56 .IP "CURLE_FTP_WEIRD_PASV_REPLY (13)"
57 libcurl failed to get a sensible result back from the server as a response to
58 either a PASV or a EPSV command. The server is flawed.
59 .IP "CURLE_FTP_WEIRD_227_FORMAT (14)"
60 FTP servers return a 227-line as a response to a PASV command. If libcurl
61 fails to parse that line, this return code is passed back.
62 .IP "CURLE_FTP_CANT_GET_HOST (15)"
63 An internal failure to lookup the host used for the new connection.
64 .IP "CURLE_FTP_CANT_RECONNECT (16)"
65 A bad return code on either PASV or EPSV was sent by the FTP server,
66 preventing libcurl from being able to continue.
67 .IP "CURLE_FTP_COULDNT_SET_BINARY (17)"
68 Received an error when trying to set the transfer mode to binary.
69 .IP "CURLE_PARTIAL_FILE (18)"
70 A file transfer was shorter or larger than expected. This happens when the
71 server first reports an expected transfer size, and then delivers data that
72 doesn't match the previously given size.
73 .IP "CURLE_FTP_COULDNT_RETR_FILE (19)"
74 This was either a weird reply to a 'RETR' command or a zero byte transfer
75 complete.
76 .IP "CURLE_FTP_WRITE_ERROR (20)"
77 After a completed file transfer, the FTP server did not respond a proper
78 \"transfer successful\" code.
79 .IP "CURLE_FTP_QUOTE_ERROR (21)"
80 When sending custom "QUOTE" commands to the remote server, one of the commands
81 returned an error code that was 400 or higher.
82 .IP "CURLE_HTTP_RETURNED_ERROR (22)"
83 This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server
84 returns an error code that is >= 400.
85 .IP "CURLE_WRITE_ERROR (23)"
86 An error occurred when writing received data to a local file, or an error was
87 returned to libcurl from a write callback.
88 .IP "CURLE_MALFORMAT_USER (24)"
89 Malformat user. User name badly specified. *Not currently used*
90 .IP "CURLE_FTP_COULDNT_STOR_FILE (25)"
91 FTP couldn't STOR file. The server denied the STOR operation. The error buffer
92 usually contains the server's explanation to this.
93 .IP "CURLE_READ_ERROR (26)"
94 There was a problem reading a local file or an error returned by the read
95 callback.
96 .IP "CURLE_OUT_OF_MEMORY (27)"
97 Out of memory. A memory allocation request failed. This is serious badness and
98 things are severely screwed up if this ever occur.
99 .IP "CURLE_OPERATION_TIMEOUTED (28)"
100 Operation timeout. The specified time-out period was reached according to the
101 conditions.
102 .IP "CURLE_FTP_COULDNT_SET_ASCII (29)"
103 libcurl failed to set ASCII transfer type (TYPE A).
104 .IP "CURLE_FTP_PORT_FAILED (30)"
105 The FTP PORT command returned error. This mostly happen when you haven't
106 specified a good enough address for libcurl to use. See \fICURLOPT_FTPPORT\fP.
107 .IP "CURLE_FTP_COULDNT_USE_REST (31)"
108 The FTP REST command returned error. This should never happen if the server is
109 sane.
110 .IP "CURLE_FTP_COULDNT_GET_SIZE (32)"
111 The FTP SIZE command returned error. SIZE is not a kosher FTP command, it is
112 an extension and not all servers support it. This is not a surprising error.
113 .IP "CURLE_HTTP_RANGE_ERROR (33)"
114 The HTTP server does not support or accept range requests.
115 .IP "CURLE_HTTP_POST_ERROR (34)"
116 This is an odd error that mainly occurs due to internal confusion.
117 .IP "CURLE_SSL_CONNECT_ERROR (35)"
118 A problem occurred somewhere in the SSL/TLS handshake. You really want the
119 error buffer and read the message there as it pinpoints the problem slightly
120 more. Could be certificates (file formats, paths, permissions), passwords, and
121 others.
122 .IP "CURLE_FTP_BAD_DOWNLOAD_RESUME (36)"
123 Attempting FTP resume beyond file size.
124 .IP "CURLE_FILE_COULDNT_READ_FILE (37)"
125 A file given with FILE:// couldn't be opened. Most likely because the file
126 path doesn't identify an existing file. Did you check file permissions?
127 .IP "CURLE_LDAP_CANNOT_BIND (38)"
128 LDAP cannot bind. LDAP bind operation failed.
129 .IP "CURLE_LDAP_SEARCH_FAILED (39)"
130 LDAP search failed.
131 .IP "CURLE_LIBRARY_NOT_FOUND (40)"
132 Library not found. The LDAP library was not found.
133 .IP "CURLE_FUNCTION_NOT_FOUND (41)"
134 Function not found. A required LDAP function was not found.
135 .IP "CURLE_ABORTED_BY_CALLBACK (42)"
136 Aborted by callback. A callback returned "abort" to libcurl.
137 .IP "CURLE_BAD_FUNCTION_ARGUMENT (43)"
138 Internal error. A function was called with a bad parameter.
139 .IP "CURLE_BAD_CALLING_ORDER (44)"
140 Internal error. A function was called in a bad order.
141 .IP "CURLE_HTTP_PORT_FAILED (45)"
142 Interface error. A specified outgoing interface could not be used. Set which
143 interface to use for outgoing connections' source IP address with
144 CURLOPT_INTERFACE.
145 .IP "CURLE_BAD_PASSWORD_ENTERED (46)"
146 Bad password entered. An error was signaled when the password was
147 entered. This can also be the result of a "bad password" returned from a
148 specified password callback.
149 .IP "CURLE_TOO_MANY_REDIRECTS (47)"
150 Too many redirects. When following redirects, libcurl hit the maximum amount.
151 Set your limit with CURLOPT_MAXREDIRS.
152 .IP "CURLE_UNKNOWN_TELNET_OPTION (48)"
153 An option set with CURLOPT_TELNETOPTIONS was not recognized/known. Refer to
154 the appropriate documentation.
155 .IP "CURLE_TELNET_OPTION_SYNTAX (49)"
156 A telnet option string was Illegally formatted.
157 .IP "CURLE_OBSOLETE (50)"
158 This is not an error. This used to be another error code in an old libcurl
159 version and is currently unused.
160 .IP "CURLE_SSL_PEER_CERTIFICATE (51)"
161 The remote server's SSL certificate was deemed not OK.
162 .IP "CURLE_GOT_NOTHING (52)"
163 Nothing was returned from the server, and under the circumstances, getting
164 nothing is considered an error.
165 .IP "CURLE_SSL_ENGINE_NOTFOUND (53)"
166 The specified crypto engine wasn't found.
167 .IP "CURLE_SSL_ENGINE_SETFAILED (54)"
168 Failed setting the selected SSL crypto engine as default!
169 .IP "CURLE_SEND_ERROR (55)"
170 Failed sending network data.
171 .IP "CURLE_RECV_ERROR (56)"
172 Failure with receiving network data.
173 .IP "CURLE_SHARE_IN_USE (57)"
174 Share is in use
175 .IP "CURLE_SSL_CERTPROBLEM (58)"
176 problem with the local certificate
177 .IP "CURLE_SSL_CIPHER (59)"
178 couldn't use specified cipher
179 .IP "CURLE_SSL_CACERT (60)"
180 problem with the CA cert (path? access rights?) 
181 .IP "CURLE_BAD_CONTENT_ENCODING (61)"
182 Unrecognized transfer encoding
183 .IP "CURLE_LDAP_INVALID_URL (62)"
184 Invalid LDAP URL
185 .IP "CURLE_FILESIZE_EXCEEDED (63)"
186 Maximum file size exceeded
187 .IP "CURLE_FTP_SSL_FAILED (64)"
188 Requested FTP SSL level failed
189 .SH "CURLMcode"
190 This is the generic return code used by functions in the libcurl multi
191 interface. Also consider \fIcurl_multi_strerror(3)\fI.
192
193 .IP "CURLM_CALL_MULTI_PERFORM (-1)"
194 This is not really an error. It means you should call
195 \fIcurl_multi_perform(3)\fP again without doing select() or similar in between.
196 .IP "CURLM_OK (0)"
197 Things are fine.
198 .IP "CURLM_BAD_HANDLE (1)"
199 The passed-in handle is not a valid CURLM handle.
200 .IP "CURLM_BAD_EASY_HANDLE (2)"
201 An easy handle was not good/valid.
202 .IP "CURLM_OUT_OF_MEMORY (3)"
203 You are doomed.
204 .IP "CURLM_INTERNAL_ERROR (4)"
205 This can only be returned if libcurl bugs. Please report it to us!
206 .SH "CURLSHcode"
207 The "share" interface will return a CURLSHcode to indicate when an error has
208 occurred.  Also consider \fIcurl_share_strerror(3)\fI.
209
210 CURLSHcode is one of the following:
211 .IP "CURLSHE_OK (0)"
212 All fine. Proceed as usual.
213 .IP "CURLSHE_BAD_OPTION (1)"
214 An invalid option was passed to the function.
215 .IP "CURLSHE_IN_USE (2)"
216 The share object is currently in use.
217 .IP "CURLSHE_INVALID (3)"
218 An invalid share object was passed to the function.
219