From efaf09ee4b6437c69c467acdb0c62a510207e993 Mon Sep 17 00:00:00 2001 From: Madelyn Olson <34459052+madolson@users.noreply.github.com> Date: Wed, 23 Dec 2020 19:06:25 -0800 Subject: Flow through the error handling path for most errors (#8226) Properly throw errors for invalid replication stream and support https://github.com/redis/redis/pull/8217 --- src/object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/object.c') diff --git a/src/object.c b/src/object.c index 71eceb6d6..583d13737 100644 --- a/src/object.c +++ b/src/object.c @@ -404,7 +404,7 @@ robj *resetRefCount(robj *obj) { int checkType(client *c, robj *o, int type) { /* A NULL is considered an empty key */ if (o && o->type != type) { - addReply(c,shared.wrongtypeerr); + addReplyErrorObject(c,shared.wrongtypeerr); return 1; } return 0; @@ -1321,13 +1321,13 @@ NULL if (getLongLongFromObjectOrReply(c,c->argv[j+1],&samples,NULL) == C_ERR) return; if (samples < 0) { - addReply(c,shared.syntaxerr); + addReplyErrorObject(c,shared.syntaxerr); return; } if (samples == 0) samples = LLONG_MAX; j++; /* skip option argument. */ } else { - addReply(c,shared.syntaxerr); + addReplyErrorObject(c,shared.syntaxerr); return; } } -- cgit v1.2.1