]> source.dussan.org Git - rspamd.git/commitdiff
Output error messages when a composite cannot be parsed.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Mar 2015 16:39:04 +0000 (16:39 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Mar 2015 16:39:04 +0000 (16:39 +0000)
src/lua/lua_config.c

index 6f77612fb5be257762c12c331e6fec52e113b0eb..23cc440a136ac7cfb8e38bae77568b1eb61c1eb9 100644 (file)
@@ -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) {