From d2ca4bb62d807291f9e21ec57c44373a03a99a5e Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 3 Apr 2014 22:10:20 +0200 Subject: [PATCH] Return "WRONGTYPE" error on PF* type mismatch. --- src/hyperloglog.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hyperloglog.c b/src/hyperloglog.c index d32a94be2..02fd2728a 100644 --- a/src/hyperloglog.c +++ b/src/hyperloglog.c @@ -464,7 +464,9 @@ int isHLLObjectOrReply(redisClient *c, robj *o) { /* If this is a string representing an HLL, the size should match * exactly. */ if (stringObjectLen(o) != REDIS_HLL_SIZE) { - addReplyErrorFormat(c, "Key is not a valid HyperLogLog string value."); + addReplySds(c, + sdsnew("-WRONGTYPE Key is not a valid " + "HyperLogLog string value.\r\n")); return REDIS_ERR; } return REDIS_OK;