Skip to content

Commit 034b94b

Browse files
committed
Say non-negative in the shared positive-count range error message
Signed-off-by: AlisinaDevelo <Alisinakarimi.2003@gmail.com>
1 parent 5c1fc15 commit 034b94b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ int getPositiveLongFromObjectOrReply(client *c, robj *o, long *target, const cha
11861186
if (msg) {
11871187
return getRangeLongFromObjectOrReply(c, o, 0, LONG_MAX, target, msg);
11881188
} else {
1189-
return getRangeLongFromObjectOrReply(c, o, 0, LONG_MAX, target, "value is out of range, must be positive");
1189+
return getRangeLongFromObjectOrReply(c, o, 0, LONG_MAX, target, "value is out of range, must be non-negative");
11901190
}
11911191
}
11921192

tests/unit/type/zset.tcl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,13 +1138,13 @@ start_server {tags {"zset"}} {
11381138

11391139
test "$pop with negative count" {
11401140
r set zset foo
1141-
assert_error "ERR *must be positive" {r $pop zset -1}
1141+
assert_error "ERR *must be non-negative" {r $pop zset -1}
11421142

11431143
r del zset
1144-
assert_error "ERR *must be positive" {r $pop zset -2}
1144+
assert_error "ERR *must be non-negative" {r $pop zset -2}
11451145

11461146
r zadd zset 1 a 2 b 3 c
1147-
assert_error "ERR *must be positive" {r $pop zset -3}
1147+
assert_error "ERR *must be non-negative" {r $pop zset -3}
11481148
}
11491149
}
11501150

0 commit comments

Comments
 (0)