summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libstat/stat_process.c4
-rw-r--r--test/functional/cases/110_statistics/lib.robot2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index efe28e280..6d98d65d0 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -757,6 +757,10 @@ rspamd_stat_backends_learn (struct rspamd_stat_ctx *st_ctx,
}
end:
+ if (!res && err) {
+ return res;
+ }
+
if (!res && sel == NULL) {
if (classifier) {
g_set_error (err, rspamd_stat_quark (), 404, "cannot find classifier "
diff --git a/test/functional/cases/110_statistics/lib.robot b/test/functional/cases/110_statistics/lib.robot
index 98a9055fe..915736f40 100644
--- a/test/functional/cases/110_statistics/lib.robot
+++ b/test/functional/cases/110_statistics/lib.robot
@@ -18,7 +18,7 @@ ${STATS_PATH_SPAM} path = "\${TMPDIR}/bayes-spam.sqlite";
*** Keywords ***
Broken Learn Test
${result} = Run Rspamc -h ${LOCAL_ADDR}:${PORT_CONTROLLER} learn_spam ${MESSAGE}
- Check Rspamc ${result} cannot find statfile backend
+ Check Rspamc ${result} Unknown statistics error
Empty Part Test
Set Test Variable ${MESSAGE} ${TESTDIR}/messages/empty_part.eml