aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan Li <yanli@infradead.org>2009-11-11 18:08:51 +0800
committerYan Li <yanli@infradead.org>2009-11-11 18:08:51 +0800
commit1dcda8555ffe7923442296d176fc7ad6d6b0815d (patch)
tree698c4ec0d8142401a6c22016df6859072021a3bd
parent862ceecbc4fe91d57f70de603564a23dcec26dba (diff)
downloadgsoc2013-evolution-1dcda8555ffe7923442296d176fc7ad6d6b0815d.tar
gsoc2013-evolution-1dcda8555ffe7923442296d176fc7ad6d6b0815d.tar.gz
gsoc2013-evolution-1dcda8555ffe7923442296d176fc7ad6d6b0815d.tar.bz2
gsoc2013-evolution-1dcda8555ffe7923442296d176fc7ad6d6b0815d.tar.lz
gsoc2013-evolution-1dcda8555ffe7923442296d176fc7ad6d6b0815d.tar.xz
gsoc2013-evolution-1dcda8555ffe7923442296d176fc7ad6d6b0815d.tar.zst
gsoc2013-evolution-1dcda8555ffe7923442296d176fc7ad6d6b0815d.zip
[PATCH] Output an error message on system filter rules loading error
Without that the user/developer has no way to know when the loading failed.
-rw-r--r--filter/rule-context.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/filter/rule-context.c b/filter/rule-context.c
index 84cf2e4e92..6c7f578a85 100644
--- a/filter/rule-context.c
+++ b/filter/rule-context.c
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -308,14 +310,22 @@ load(RuleContext *rc, const gchar *system, const gchar *user)
systemdoc = e_xml_parse_file (system);
if (systemdoc == NULL) {
- rule_context_set_error(rc, g_strdup_printf("Unable to load system rules '%s': %s",
- system, g_strerror(errno)));
+ gchar * err_msg = g_strdup_printf("Unable to load system rules '%s': %s",
+ system, g_strerror(errno));
+ g_warning(err_msg);
+ rule_context_set_error(rc, err_msg);
+ /* no need to free err_msg here */
return -1;
}
root = xmlDocGetRootElement(systemdoc);
if (root == NULL || strcmp((gchar *)root->name, "filterdescription")) {
- rule_context_set_error(rc, g_strdup_printf("Unable to load system rules '%s': Invalid format", system));
+ gchar * err_msg = g_strdup_printf(
+ "Unable to load system rules '%s': Invalid format",
+ system);
+ g_warning(err_msg);
+ rule_context_set_error(rc, err_msg);
+ /* no need to free err_msg here */
xmlFreeDoc(systemdoc);
return -1;
}