diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-04-23 01:01:25 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-04-23 02:04:26 +0800 |
commit | 87c767a4f6dfa32f5f66e36af8a31b2cbde56a7a (patch) | |
tree | d2e4fc657633f94d5d671419f95a0a94f29edb62 /mail/e-mail-local.c | |
parent | be3025aa4451ea342f519db940e56c1a9d4d519f (diff) | |
download | gsoc2013-evolution-87c767a4f6dfa32f5f66e36af8a31b2cbde56a7a.tar.gz gsoc2013-evolution-87c767a4f6dfa32f5f66e36af8a31b2cbde56a7a.tar.zst gsoc2013-evolution-87c767a4f6dfa32f5f66e36af8a31b2cbde56a7a.zip |
e_mail_local_init(): Improve error handling.
Diffstat (limited to 'mail/e-mail-local.c')
-rw-r--r-- | mail/e-mail-local.c | 21 |
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); } |