Hi,
I was a little surprised to find that for some error codes, no error message was placed in the buffer I had supplied with CURLOPT_ERRORBUFFER. On re-reading the manual page, I had to admit that it says "libcurl may store human readable error messages" without expanding on the circumstances when it may or may not.

Could I suggest adding something along the lines of:

"The recommended way to get a human readable error message is as follows. Before the performing transfer, store a null byte in the first character of the buffer. After the transfer completes with a non-zero CURLcode, check if the first byte of the buffer is still null - if not, use the message which libcurl has placed there; if it is still null, call curl_easy_strerror with the CURLcode to obtain a message."

--
Colin Hogben

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to