cURL / Mailing Lists / curl-library / Single Mail

curl-library

more detailed error reporting

From: Serge Semashko <ss_at_vba.com.by>
Date: Sat, 31 May 2003 12:38:21 +0300

Here is a simple patch for more detailed error reporting in
CURLOPT_FAILONERROR mode.

===================================================================
RCS file: /cvsroot/curl/curl/lib/transfer.c,v
retrieving revision 1.153
diff -u -r1.153 transfer.c
--- transfer.c 23 May 2003 09:47:57 -0000 1.153
+++ transfer.c 31 May 2003 09:31:15 -0000
@@ -531,7 +531,20 @@
                   /* If we have been told to fail hard on HTTP-errors,
                      here is the check for that: */
                   /* serious error, go home! */
- failf (data, "The requested file was not found");
+ switch (k->httpcode) {
+ case 403:
+ failf (data, "Access to the requested file is forbidden");
+ break;
+ case 404:
+ failf (data, "The requested file was not found");
+ break;
+ case 407:
+ failf (data, "Proxy authentication required");
+ break;
+ default:
+ failf (data, "HTTP server returned %d", k->httpcode);
+ break;
+ }
                   return CURLE_HTTP_RETURNED_ERROR;
                 }

-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Received on 2003-05-31