commit 58037bb: [Minor] Change error to the notice

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Nov 16 10:14:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-11-16 10:08:06 +0000
URL: https://github.com/rspamd/rspamd/commit/58037bbffc0e3fd7873b6b411ea2c3aeb0f3ea91 (HEAD -> master)

[Minor] Change error to the notice
With this change, Rspamd will no longer emit error codes on learn condition skipping.

Issue: #3956

---
 src/libstat/stat_process.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index 338dc3034..c697d2fd8 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -710,7 +710,7 @@ rspamd_stat_backends_learn (struct rspamd_stat_ctx *st_ctx,
 				/* XXX: must be error */
 				if (task->result->passthrough_result) {
 					/* Passthrough email, cannot learn */
-					g_set_error (err, rspamd_stat_quark (), 500,
+					g_set_error (err, rspamd_stat_quark (), 204,
 							"Cannot learn statistics when passthrough "
 							"result has been set; not classified");
 
@@ -774,7 +774,7 @@ end:
 			return FALSE;
 		}
 		else if (!backend_found) {
-			g_set_error(err, rspamd_stat_quark(), 404, "all learn conditions "
+			g_set_error(err, rspamd_stat_quark(), 204, "all learn conditions "
 													   "denied learning %s in %s",
 					spam ? "spam" : "ham",
 					classifier ? classifier : "default classifier");


More information about the Commits mailing list