aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-12-03 23:29:02 +0800
committerMilan Crha <mcrha@redhat.com>2012-12-03 23:29:02 +0800
commitb9b56d39cc500e5393545414af3d3315ded3ee74 (patch)
tree1c44bca0733c067611da9db759a7833a5663e911
parent2074c0b628cfd2cebbbcf7db36cd5ece9f00accf (diff)
downloadgsoc2013-evolution-b9b56d39cc500e5393545414af3d3315ded3ee74.tar
gsoc2013-evolution-b9b56d39cc500e5393545414af3d3315ded3ee74.tar.gz
gsoc2013-evolution-b9b56d39cc500e5393545414af3d3315ded3ee74.tar.bz2
gsoc2013-evolution-b9b56d39cc500e5393545414af3d3315ded3ee74.tar.lz
gsoc2013-evolution-b9b56d39cc500e5393545414af3d3315ded3ee74.tar.xz
gsoc2013-evolution-b9b56d39cc500e5393545414af3d3315ded3ee74.tar.zst
gsoc2013-evolution-b9b56d39cc500e5393545414af3d3315ded3ee74.zip
Bug #525932 - Unhelpful "Error while Filtering Selected Messages."
-rw-r--r--libemail-engine/mail-ops.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c
index bc49261c31..d93a17b45f 100644
--- a/libemail-engine/mail-ops.c
+++ b/libemail-engine/mail-ops.c
@@ -104,6 +104,7 @@ em_filter_folder_element_exec (struct _filter_mail_msg *m,
CamelFolder *folder;
GPtrArray *uids, *folder_uids = NULL;
gboolean success = TRUE;
+ GError *local_error = NULL;
folder = m->source_folder;
@@ -124,16 +125,16 @@ em_filter_folder_element_exec (struct _filter_mail_msg *m,
success = camel_filter_driver_filter_folder (
m->driver, folder, m->cache, uids, m->delete,
- cancellable, error) == 0;
- camel_filter_driver_flush (m->driver, error);
+ cancellable, &local_error) == 0;
+ camel_filter_driver_flush (m->driver, &local_error);
if (folder_uids)
camel_folder_free_uids (folder, folder_uids);
/* sync our source folder */
- if (!m->cache)
+ if (!m->cache && !local_error)
camel_folder_synchronize_sync (
- folder, FALSE, cancellable, error);
+ folder, FALSE, cancellable, &local_error);
camel_folder_thaw (folder);
if (m->destination)
@@ -144,6 +145,17 @@ em_filter_folder_element_exec (struct _filter_mail_msg *m,
g_object_unref (m->driver);
m->driver = NULL;
+ if (g_error_matches (local_error, CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_URL_INVALID) ||
+ g_error_matches (local_error, CAMEL_FOLDER_ERROR, CAMEL_FOLDER_ERROR_INVALID)) {
+ g_set_error (error, local_error->domain, local_error->code,
+ _("Failed to filter selected messages. One reason can be that folder "
+ "location set in one or more filters is invalid. Please check your "
+ "filters in Edit->Message Filters.\n"
+ "Original error was: %s"), local_error->message);
+ g_clear_error (&local_error);
+ } else if (local_error)
+ g_propagate_error (error, local_error);
+
return success;
}