aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-24 16:39:04 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-24 16:39:04 +0000
commit40f5a0b1be6ed9da17fb6a0abf41786bd1f0dc9a (patch)
treebca984b440a12683a8fcd416e04cb05eb562fde8 /src
parentf97231861ede18543fbde480225075c6087416d6 (diff)
downloadrspamd-40f5a0b1be6ed9da17fb6a0abf41786bd1f0dc9a.tar.gz
rspamd-40f5a0b1be6ed9da17fb6a0abf41786bd1f0dc9a.zip
Output error messages when a composite cannot be parsed.
Diffstat (limited to 'src')
-rw-r--r--src/lua/lua_config.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index 6f77612fb..23cc440a1 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -1137,6 +1137,7 @@ lua_config_add_composite (lua_State * L)
const gchar *expr_str;
struct rspamd_composite *composite;
gboolean ret = FALSE, new = TRUE;
+ GError *err = NULL;
if (cfg) {
name = rspamd_mempool_strdup (cfg->cfg_pool, luaL_checkstring (L, 2));
@@ -1144,8 +1145,10 @@ lua_config_add_composite (lua_State * L)
if (name && expr_str) {
if (!rspamd_parse_expression (expr_str, 0, &composite_expr_subr,
- NULL, cfg->cfg_pool, NULL, &expr)) {
- msg_err ("cannot parse composite expression %s", expr_str);
+ NULL, cfg->cfg_pool, &err, &expr)) {
+ msg_err ("cannot parse composite expression %s: %e", expr_str,
+ err);
+ g_error_free (err);
}
else {
if (g_hash_table_lookup (cfg->composite_symbols, name) != NULL) {