aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat/stat_process.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-27 11:56:28 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-27 11:56:28 +0000
commitd8c8fd5641a138cdf6e7dd6ee8dae39c4815cbae (patch)
tree4197ccecb08fe05bac0fac49b08a81506c9af641 /src/libstat/stat_process.c
parentff2894404eadc85f19cdff4e71ac6d96eddb839b (diff)
downloadrspamd-d8c8fd5641a138cdf6e7dd6ee8dae39c4815cbae.tar.gz
rspamd-d8c8fd5641a138cdf6e7dd6ee8dae39c4815cbae.zip
[Fix] Treat learning errors as non-fatal
Issue: #2637
Diffstat (limited to 'src/libstat/stat_process.c')
-rw-r--r--src/libstat/stat_process.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index d601dbee9..d097e12e0 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -526,7 +526,7 @@ rspamd_stat_classifiers_learn (struct rspamd_stat_ctx *st_ctx,
if ((task->flags & RSPAMD_TASK_FLAG_ALREADY_LEARNED) && err != NULL &&
*err == NULL) {
/* Do not learn twice */
- g_set_error (err, rspamd_stat_quark (), 404, "<%s> has been already "
+ g_set_error (err, rspamd_stat_quark (), 208, "<%s> has been already "
"learned as %s, ignore it", task->message_id,
spam ? "spam" : "ham");
@@ -635,7 +635,7 @@ rspamd_stat_classifiers_learn (struct rspamd_stat_ctx *st_ctx,
if (!learned && err && *err == NULL) {
if (too_large) {
- g_set_error (err, rspamd_stat_quark (), 400,
+ g_set_error (err, rspamd_stat_quark (), 204,
"<%s> contains more tokens than allowed for %s classifier: "
"%d > %d",
task->message_id,
@@ -644,7 +644,7 @@ rspamd_stat_classifiers_learn (struct rspamd_stat_ctx *st_ctx,
cl->cfg->max_tokens);
}
else if (too_small) {
- g_set_error (err, rspamd_stat_quark (), 400,
+ g_set_error (err, rspamd_stat_quark (), 204,
"<%s> contains less tokens than required for %s classifier: "
"%d < %d",
task->message_id,
@@ -653,7 +653,7 @@ rspamd_stat_classifiers_learn (struct rspamd_stat_ctx *st_ctx,
cl->cfg->min_tokens);
}
else if (conditionally_skipped) {
- g_set_error (err, rspamd_stat_quark (), 410,
+ g_set_error (err, rspamd_stat_quark (), 204,
"<%s> is skipped for %s classifier: "
"%s",
task->message_id,