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/t_list.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/t_list.c')
-rw-r--r-- | src/t_list.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/t_list.c b/src/t_list.c index 1b4062c38..c8323c612 100644 --- a/src/t_list.c +++ b/src/t_list.c @@ -294,7 +294,7 @@ void linsertCommand(client *c) { } else if (strcasecmp(c->argv[2]->ptr,"before") == 0) { where = LIST_HEAD; } else { - addReply(c,shared.syntaxerr); + addReplyErrorObject(c,shared.syntaxerr); return; } @@ -373,7 +373,7 @@ void lsetCommand(client *c) { int replaced = quicklistReplaceAtIndex(ql, index, value->ptr, sdslen(value->ptr)); if (!replaced) { - addReply(c,shared.outofrangeerr); + addReplyErrorObject(c,shared.outofrangeerr); } else { addReply(c,shared.ok); signalModifiedKey(c,c->db,c->argv[1]); @@ -566,7 +566,7 @@ void lposCommand(client *c) { return; } } else { - addReply(c,shared.syntaxerr); + addReplyErrorObject(c,shared.syntaxerr); return; } } @@ -698,7 +698,7 @@ int getListPositionFromObjectOrReply(client *c, robj *arg, int *position) { } else if (strcasecmp(arg->ptr,"left") == 0) { *position = LIST_HEAD; } else { - addReply(c,shared.syntaxerr); + addReplyErrorObject(c,shared.syntaxerr); return C_ERR; } return C_OK; |