diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-08-12 19:05:29 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-08-12 19:05:29 +0100 |
commit | ea826b71491fbc6e061b195b4d8bdb9c4b34711b (patch) | |
tree | 870764034c59b74327ba164a6e97e5117e8c8c9d /src/libstat | |
parent | 3ae5828cfed2dd526b6e79256630920c5b2b4b6a (diff) | |
download | rspamd-ea826b71491fbc6e061b195b4d8bdb9c4b34711b.tar.gz rspamd-ea826b71491fbc6e061b195b4d8bdb9c4b34711b.zip |
[Minor] Improve error message when learning with passthrough result
Issue: #3339
Diffstat (limited to 'src/libstat')
-rw-r--r-- | src/libstat/stat_process.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c index aed588073..9cd425206 100644 --- a/src/libstat/stat_process.c +++ b/src/libstat/stat_process.c @@ -679,6 +679,16 @@ rspamd_stat_backends_learn (struct rspamd_stat_ctx *st_ctx, if (bk_run == NULL) { /* XXX: must be error */ + if (task->result->passthrough_result) { + /* Passthrough email, cannot learn */ + g_set_error (err, rspamd_stat_quark (), 500, + "Cannot learn statistics when passthrough " + "result has been set; not classified"); + + res = FALSE; + goto end; + } + msg_warn_task ("no runtime for backend %s; classifier %s; symbol %s", st->backend->name, cl->cfg->name, st->stcf->symbol); continue; |