aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat/backends
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-04-21 12:35:04 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-04-21 12:35:22 +0100
commit2ea40ec56af673b2aec231e7454a27e29fe39126 (patch)
treeb6f7fb60d12f559d1a643e9c9c8132d12d17a135 /src/libstat/backends
parente1c631ca5364f1694e1633f69edd867e62fc26c4 (diff)
downloadrspamd-2ea40ec56af673b2aec231e7454a27e29fe39126.tar.gz
rspamd-2ea40ec56af673b2aec231e7454a27e29fe39126.zip
[Minor] Improve logging for REDIS_REPLY_ERROR
Diffstat (limited to 'src/libstat/backends')
-rw-r--r--src/libstat/backends/redis_backend.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c
index 392f1704e..4136ab092 100644
--- a/src/libstat/backends/redis_backend.c
+++ b/src/libstat/backends/redis_backend.c
@@ -1212,8 +1212,14 @@ rspamd_redis_processed (redisAsyncContext *c, gpointer r, gpointer priv)
}
}
else {
- msg_err_task_check ("got invalid reply from redis: %s, array expected",
- rspamd_redis_type_to_string (reply->type));
+ if (reply->type == REDIS_REPLY_ERROR) {
+ msg_err_task_check ("cannot learn %s: redis error: \"%s\"",
+ rt->stcf->symbol, reply->str);
+ }
+ else {
+ msg_err_task_check ("got invalid reply from redis: %s, array expected",
+ rspamd_redis_type_to_string(reply->type));
+ }
}
msg_debug_stat_redis ("received tokens for %s: %d processed, %d found",
@@ -1264,9 +1270,15 @@ rspamd_redis_connected (redisAsyncContext *c, gpointer r, gpointer priv)
}
else {
if (reply->type != REDIS_REPLY_NIL) {
- msg_err_task ("bad learned type for %s: %s, nil expected",
- rt->stcf->symbol,
- rspamd_redis_type_to_string (reply->type));
+ if (reply->type == REDIS_REPLY_ERROR) {
+ msg_err_task ("cannot learn %s: redis error: \"%s\"",
+ rt->stcf->symbol, reply->str);
+ }
+ else {
+ msg_err_task ("bad learned type for %s: %s, nil expected",
+ rt->stcf->symbol,
+ rspamd_redis_type_to_string(reply->type));
+ }
}
val = 0;