[evolution-kolab/ek-wip-xfb: 1/8] libekolabutil: print verbose Curl error messages



commit 983479dbc650e6d4676894dcdf379441b8ff6b7c
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Mon Oct 22 15:42:46 2012 +0200

    libekolabutil: print verbose Curl error messages
    
    * instead of logging the mere CURLcode, also retrieve
      the error message for the code from libcurl and log
      it

 src/libekolabutil/kolab-util-http.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/libekolabutil/kolab-util-http.c b/src/libekolabutil/kolab-util-http.c
index df39968..a11ae86 100644
--- a/src/libekolabutil/kolab-util-http.c
+++ b/src/libekolabutil/kolab-util-http.c
@@ -278,8 +278,9 @@ util_http_curl_get (KolabUtilHttpJob *job, GError **error)
 		g_set_error (error,
 		             KOLAB_UTIL_HTTP_ERROR,
 		             KOLAB_UTIL_HTTP_ERROR_CONFIGURATION_ERROR,
-		             _("Configuring libcurl failed with CURLcode: %u"),
-		             curlcode);
+		             _("Configuring libcurl failed with CURLcode: %u (%s)"),
+		             curlcode,
+		             curl_easy_strerror (curlcode));
 		return -1;
 	}
 
@@ -300,8 +301,9 @@ util_http_curl_get (KolabUtilHttpJob *job, GError **error)
 		g_set_error (error,
 		             KOLAB_UTIL_HTTP_ERROR,
 		             error_code,
-		             _("Access to URL '%s' failed in libcurl with CURLcode: %u"),
-		             camel_url_to_string (job->url, CAMEL_URL_HIDE_AUTH), curlcode);
+		             _("Access to URL '%s' failed in libcurl with CURLcode: %u (%s)"),
+		             camel_url_to_string (job->url, CAMEL_URL_HIDE_AUTH),
+		             curlcode, curl_easy_strerror (curlcode));
 	}
 	else {
 		nbytes = (gssize)job->buffer->len;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]