Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix to use command name when SETEX/PSETEX fail #811

Closed
wants to merge 1 commit into from

3 participants

@charsyam

when using SETEX/PSETEX and when their expire time is less than 0
their error message are the same.

redis 127.0.0.1:6379> SETEX mykey -1 "Hello"
(error) ERR invalid expire time in SETEX
(5.60s)
redis 127.0.0.1:6379> PSETEX mykey -1 "Hello"
(error) ERR invalid expire time in SETEX
(3.69s)

so I changed to use their own names when PSETEX fails

redis 127.0.0.1:6379> SETEX mykey -1 "Hello"
(error) ERR invalid expire time in SETEX
redis 127.0.0.1:6379> PSETEX mykey -1 "Hello"
(error) ERR invalid expire time in PSETEX
redis 127.0.0.1:6379> 
@mattsta mattsta referenced this pull request from a commit in mattsta/redis
@mattsta mattsta Fix error message of SETEX/PSETEX
This is a rewritten version of #811

Closes #811
ad70df4
@mattsta mattsta referenced this pull request from a commit in mattsta/redis
@mattsta mattsta Fix error message of SETEX/PSETEX
This is a rewritten version of #811

Closes #811
2a0c018
@mattsta mattsta referenced this pull request
Closed

ALL simple issue fixes #1906

@mattsta mattsta referenced this pull request from a commit in mattsta/redis
@mattsta mattsta Fix error message of SETEX/PSETEX
This is a rewritten version of #811

Closes #811
cd3905d
@mattsta

Fixed in a6edfce (command name is now lowercase in error message).

@mattsta mattsta closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 5, 2012
  1. @openbaas
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/t_string.c
View
4 src/t_string.c
@@ -49,7 +49,9 @@ void setGenericCommand(redisClient *c, int nx, robj *key, robj *val, robj *expir
if (getLongLongFromObjectOrReply(c, expire, &milliseconds, NULL) != REDIS_OK)
return;
if (milliseconds <= 0) {
- addReplyError(c,"invalid expire time in SETEX");
+ char buf[128];
+ sprintf( buf, "invalid expire time in %s", (char *)(c->argv[0]->ptr) );
+ addReplyError(c,buf);
return;
}
if (unit == UNIT_SECONDS) milliseconds *= 1000;
Something went wrong with that request. Please try again.