From 3b46cf97de6c5d7f2602dda924703db4f87efcc3 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 15 May 2017 11:22:28 +0200 Subject: [PATCH] redis-cli --bigkeys: show error when TYPE fails. Close #3993. --- src/redis-cli.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/redis-cli.c b/src/redis-cli.c index 9c1de0a23..40f917624 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -2022,8 +2022,13 @@ static void getKeyTypes(redisReply *keys, int *types) { keys->element[i]->str, context->err, context->errstr); exit(1); } else if(reply->type != REDIS_REPLY_STATUS) { - fprintf(stderr, "Invalid reply type (%d) for TYPE on key '%s'!\n", - reply->type, keys->element[i]->str); + if(reply->type == REDIS_REPLY_ERROR) { + fprintf(stderr, "TYPE returned an error: %s\n", reply->str); + } else { + fprintf(stderr, + "Invalid reply type (%d) for TYPE on key '%s'!\n", + reply->type, keys->element[i]->str); + } exit(1); } -- GitLab