summaryrefslogtreecommitdiff
path: root/tests/support
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2012-04-06 23:52:28 +0200
committerantirez <antirez@gmail.com>2012-04-06 23:52:28 +0200
commitff79ab71dbb1443edd4273e3b1022b76ccbd3ab5 (patch)
tree502350e05c687892efe2e07060e0fcb0427dbc2d /tests/support
parent618a922957803cb9f5fc944dd0630d7d61008d06 (diff)
downloadredis-ff79ab71dbb1443edd4273e3b1022b76ccbd3ab5.tar.gz
redis.tcl: no longer leave unread replies if an error happens during a MULTI/EXEC block.
Diffstat (limited to 'tests/support')
-rw-r--r--tests/support/redis.tcl8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/support/redis.tcl b/tests/support/redis.tcl
index ca6cf34b6..99415b640 100644
--- a/tests/support/redis.tcl
+++ b/tests/support/redis.tcl
@@ -142,9 +142,15 @@ proc ::redis::redis_multi_bulk_read fd {
set count [redis_read_line $fd]
if {$count == -1} return {}
set l {}
+ set err {}
for {set i 0} {$i < $count} {incr i} {
- lappend l [redis_read_reply $fd]
+ if {[catch {
+ lappend l [redis_read_reply $fd]
+ } e] && $err eq {}} {
+ set err $e
+ }
}
+ if {$err ne {}} {return -code error $err}
return $l
}