From 015bbda11c6760d2ce5d35fa3ad0896dddbcd8c1 Mon Sep 17 00:00:00 2001 From: Pavel Rochnyack Date: Sun, 17 Jun 2018 17:08:49 +0700 Subject: [PATCH] redis plugin: Change text of some error messages --- src/redis.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/redis.c b/src/redis.c index 9568fc57..f4de3800 100644 --- a/src/redis.c +++ b/src/redis.c @@ -317,12 +317,14 @@ static int redis_handle_query(redisContext *rh, redis_node_t *rn, ds = plugin_get_ds(rq->type); if (!ds) { - ERROR("redis plugin: DataSet `%s' not defined.", rq->type); + ERROR("redis plugin: DS type `%s' not defined.", rq->type); return -1; } if (ds->ds_num != 1) { - ERROR("redis plugin: DS `%s' has too many types.", rq->type); + ERROR("redis plugin: DS type `%s' has too many datasources. This is not " + "supported currently.", + rq->type); return -1; } @@ -356,13 +358,20 @@ static int redis_handle_query(redisContext *rh, redis_node_t *rn, break; case REDIS_REPLY_STRING: if (parse_value(rr->str, &val, ds->ds[0].type) == -1) { - WARNING("redis plugin: Unable to parse field `%s'.", rq->type); + WARNING("redis plugin: Query `%s': Unable to parse value.", rq->query); freeReplyObject(rr); return -1; } break; + case REDIS_REPLY_ARRAY: + WARNING("redis plugin: Query `%s' should return string or integer. Arrays " + "are not supported.", + rq->query); + freeReplyObject(rr); + return -1; default: - WARNING("redis plugin: Cannot coerce redis type."); + WARNING("redis plugin: Query `%s': Cannot coerce redis type (%i).", + rq->query, rr->type); freeReplyObject(rr); return -1; } -- 2.11.0