aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-filter-driver.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-01-23 12:37:59 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-01-23 12:37:59 +0800
commit4cf9b5a00cb088a3d40974f48b69120afcaf1b68 (patch)
treeaf8502deb7d160d121e63bb2e5de2b5671f89850 /camel/camel-filter-driver.c
parent73053088aa1a33486a1bfb9637bf37f8bf984a18 (diff)
downloadgsoc2013-evolution-4cf9b5a00cb088a3d40974f48b69120afcaf1b68.tar.gz
gsoc2013-evolution-4cf9b5a00cb088a3d40974f48b69120afcaf1b68.tar.zst
gsoc2013-evolution-4cf9b5a00cb088a3d40974f48b69120afcaf1b68.zip
Perform error checking on parsing/execution.
2001-01-23 Not Zed <NotZed@Ximian.com> * camel-filter-search.c (camel_filter_search_match): Perform error checking on parsing/execution. * camel-folder-search.c (camel_folder_search_execute_expression): Perform error handling on search expression. (CamelFolderSearchPrivate): Add a camelexception for error returns. (camel_folder_search_execute_expression): Setup exception pointer. (search_match_all): Quit on error. * providers/imap/camel-imap-summary.c (message_info_load): Removed some debug 'warnings', as they should now be displayed at the toplevel loader, and just made the code match similar code elsewhere. * providers/local/camel-mbox-summary.c (message_info_load): Error handling. (message_info_save): more error handling. * camel-folder-summary.c (message_info_load): Add error handling and sanity checking. (camel_folder_summary_load): Add error checks. (perform_content_info_load): Error + sanity checks. (content_info_load): error + sanity checks. svn path=/trunk/; revision=7739
Diffstat (limited to 'camel/camel-filter-driver.c')
-rw-r--r--camel/camel-filter-driver.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index 69229321fe..a39186cd85 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -761,13 +761,18 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
if (camel_filter_search_match(p->message, p->info, source_url, node->match, p->ex)) {
filtered = TRUE;
camel_filter_driver_log (driver, FILTER_LOG_START, node->name);
-#ifndef NO_WARNINGS
-#warning "Must check expression parsed and executed properly?"
-#endif
+
/* perform necessary filtering actions */
e_sexp_input_text (p->eval, node->action, strlen (node->action));
- e_sexp_parse (p->eval);
+ if (e_sexp_parse (p->eval) == -1) {
+ camel_exception_setv(ex, 1, _("Error parsing filter: %s: %s"), e_sexp_error(p->eval), node->action);
+ goto error;
+ }
r = e_sexp_eval (p->eval);
+ if (r == NULL) {
+ camel_exception_setv(ex, 1, _("Error executing filter: %s: %s"), e_sexp_error(p->eval), node->action);
+ goto error;
+ }
e_sexp_result_free (r);
if (p->terminated)
break;
@@ -786,10 +791,11 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver, CamelMimeMessage
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Copy to default folder");
camel_folder_append_message (p->defaultfolder, p->message, p->info, p->ex);
}
+
+error:
+ if (filtered)
+ camel_filter_driver_log (driver, FILTER_LOG_END, NULL);
if (freeinfo)
camel_message_info_free (info);
-
- if (filtered)
- camel_filter_driver_log (driver, FILTER_LOG_END, NULL);
}