aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-04-23 01:01:25 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:56 +0800
commit1328cb5e4a9b9b9f26fac567ffd4fab5821318aa (patch)
tree4647860489668621f76ce13d2d98ba07f61c5d28
parent55def673bd9d9f951cfc5b69eb485a8f8a6998fa (diff)
downloadgsoc2013-evolution-1328cb5e4a9b9b9f26fac567ffd4fab5821318aa.tar
gsoc2013-evolution-1328cb5e4a9b9b9f26fac567ffd4fab5821318aa.tar.gz
gsoc2013-evolution-1328cb5e4a9b9b9f26fac567ffd4fab5821318aa.tar.bz2
gsoc2013-evolution-1328cb5e4a9b9b9f26fac567ffd4fab5821318aa.tar.lz
gsoc2013-evolution-1328cb5e4a9b9b9f26fac567ffd4fab5821318aa.tar.xz
gsoc2013-evolution-1328cb5e4a9b9b9f26fac567ffd4fab5821318aa.tar.zst
gsoc2013-evolution-1328cb5e4a9b9b9f26fac567ffd4fab5821318aa.zip
e_mail_local_init(): Improve error handling.
-rw-r--r--mail/e-mail-local.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/mail/e-mail-local.c b/mail/e-mail-local.c
index 42161c2d42..a61e9dcd36 100644
--- a/mail/e-mail-local.c
+++ b/mail/e-mail-local.c
@@ -51,7 +51,7 @@ e_mail_local_init (EMailSession *session,
CamelURL *url;
gchar *temp;
gint ii;
- GError *local_error = NULL;
+ GError *error = NULL;
if (mail_local_initialized)
return;
@@ -70,10 +70,10 @@ e_mail_local_init (EMailSession *session,
temp = camel_url_to_string (url, 0);
service = camel_session_add_service (
CAMEL_SESSION (session), "local", temp,
- CAMEL_PROVIDER_STORE, &local_error);
+ CAMEL_PROVIDER_STORE, &error);
g_free (temp);
- if (local_error != NULL)
+ if (error != NULL)
goto fail;
/* Populate the rest of the default_local_folders array. */
@@ -92,12 +92,17 @@ e_mail_local_init (EMailSession *session,
if (!strcmp (display_name, "Inbox"))
default_local_folders[ii].folder =
camel_store_get_inbox_folder_sync (
- CAMEL_STORE (service), NULL, NULL);
+ CAMEL_STORE (service), NULL, &error);
else
default_local_folders[ii].folder =
camel_store_get_folder_sync (
CAMEL_STORE (service), display_name,
- CAMEL_STORE_FOLDER_CREATE, NULL, NULL);
+ CAMEL_STORE_FOLDER_CREATE, NULL, &error);
+
+ if (error != NULL) {
+ g_critical ("%s", error->message);
+ g_clear_error (&error);
+ }
}
camel_url_free (url);
@@ -108,11 +113,11 @@ e_mail_local_init (EMailSession *session,
return;
fail:
- g_warning (
+ g_critical (
"Could not initialize local store/folder: %s",
- local_error->message);
+ error->message);
- g_error_free (local_error);
+ g_error_free (error);
camel_url_free (url);
}