[evolution-kolab/ek-wip-porting] kolab-util-calendar: reworked error handling for free-busy triggers



commit a13fd9c220965bc7c801b8863c052ec736717da5
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Mon Sep 10 16:48:34 2012 +0200

    kolab-util-calendar: reworked error handling for free-busy triggers

 src/calendar/kolab-util-calendar.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/src/calendar/kolab-util-calendar.c b/src/calendar/kolab-util-calendar.c
index 7d9afec..fa86b89 100644
--- a/src/calendar/kolab-util-calendar.c
+++ b/src/calendar/kolab-util-calendar.c
@@ -57,9 +57,11 @@ util_calendar_create_http_request (KolabSettingsHandler *ksettings,
 	                                                KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_USER_PASSWORD,
 	                                                &tmp_err);
 	if (passwd == NULL) {
-		g_warning ("%s()[%u]: no password supplied! (%s)",
-		           __func__, __LINE__, tmp_err->message);
-		g_error_free (tmp_err);
+		g_warning ("%s()[%u]: no password supplied!", __func__, __LINE__);
+		if (tmp_err != NULL) {
+			g_warning ("%s()[%u]: %s", __func__, __LINE__, tmp_err->message);
+			g_error_free (tmp_err);
+		}
 	}
 
 	job = kolab_util_http_job_new ();
@@ -100,7 +102,7 @@ util_calendar_create_pfb_trigger (KolabSettingsHandler *ksettings,
 	                                         path,
 	                                         &tmp_err);
 	g_free (path);
-	if (job == NULL) {
+	if (tmp_err != NULL) {
 		g_propagate_error (error, tmp_err);
 		return NULL;
 	}
@@ -126,7 +128,7 @@ util_calendar_create_xfb_request (KolabSettingsHandler *ksettings,
 	                                         path,
 	                                         &tmp_err);
 	g_free (path);
-	if (job == NULL) {
+	if (tmp_err != NULL) {
 		g_propagate_error (error, tmp_err);
 		g_warning ("%s()[%u] call to kolab_util_calendar_create_http_request() returned NULL!",
 		           __func__, __LINE__);
@@ -206,7 +208,8 @@ kolab_util_calendar_toggle_pfb_trigger (KolabSettingsHandler *ksettings,
 	                                        sourcename,
 	                                        &tmp_err);
 	if (job == NULL) {
-		g_propagate_error (error, tmp_err);
+		if (tmp_err != NULL)
+			g_propagate_error (error, tmp_err);
 		g_warning ("%s()[%u] error: could not create F/B toggle, giving up on %s.",
 		           __func__, __LINE__, sourcename);
 		return FALSE;
@@ -247,7 +250,7 @@ kolab_util_calendar_retrieve_xfb (KolabSettingsHandler *ksettings,
 	job->buffer = g_byte_array_new ();
 	(void)kolab_util_http_get (job, &tmp_err);
 	if (tmp_err != NULL) {
-		/* might happen, perhaps the server did not now about the user. */
+		/* might happen, perhaps the server did not know about the user. */
 		kolab_util_http_job_free (job);
 		g_propagate_error (error, tmp_err);
 		return NULL;



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