diff options
author | Madelyn Olson <34459052+madolson@users.noreply.github.com> | 2020-12-23 19:06:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-23 19:06:25 -0800 |
commit | efaf09ee4b6437c69c467acdb0c62a510207e993 (patch) | |
tree | b8eb22c7360cb9db2959b5cb3f26813698c3a3e7 /src/object.c | |
parent | 55abd1c6d078e0d30ee01a819f069fa7737c3dc2 (diff) | |
download | redis-efaf09ee4b6437c69c467acdb0c62a510207e993.tar.gz |
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
Diffstat (limited to 'src/object.c')
-rw-r--r-- | src/object.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; } } |