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/geo.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/geo.c')
-rw-r--r-- | src/geo.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -100,8 +100,8 @@ int extractLongLatOrReply(client *c, robj **argv, double *xy) { } if (xy[0] < GEO_LONG_MIN || xy[0] > GEO_LONG_MAX || xy[1] < GEO_LAT_MIN || xy[1] > GEO_LAT_MAX) { - addReplySds(c, sdscatprintf(sdsempty(), - "-ERR invalid longitude,latitude pair %f,%f\r\n",xy[0],xy[1])); + addReplyErrorFormat(c, + "-ERR invalid longitude,latitude pair %f,%f\r\n",xy[0],xy[1]); return C_ERR; } return C_OK; @@ -902,7 +902,7 @@ void geodistCommand(client *c) { to_meter = extractUnitOrReply(c,c->argv[4]); if (to_meter < 0) return; } else if (c->argc > 5) { - addReply(c,shared.syntaxerr); + addReplyErrorObject(c,shared.syntaxerr); return; } |