neophenix / Redis-hiredis

Perl wrapper around hiredis client
BSD 3-Clause "New" or "Revised" License
11 stars 8 forks source link

multi/exec support #1

Open chloe-zen opened 13 years ago

chloe-zen commented 13 years ago

SV * _read_bulk_reply (Redis__hiredis self, redisReply reply) { SV sv; if ( reply->type == REDIS_REPLY_ERROR ) { croak("%s",reply->str); }

When you use MULTI/EXEC, bulk replies can include errors.

neophenix commented 13 years ago

How very annoying. An easy fix is done, but I am not sure I like it so I will think about it a little longer. Thanks for opening the issue.

neophenix commented 13 years ago

Well, I don't like that I now croak on errors in a single reply, and just return the strings in a multi bulk, but for now this works so I pushed it up here. I'm going to look at doing the returns differently in the future while hopefully not hosing BC.

"Fixed" in : SHA: cc304184ed75636884ddd80d64310aa07fad7b10

chloe-zen commented 13 years ago

AnyEvent::Redis uses an AE::R::Error object, which can be batched as well as returned alone. One of the multitude of exception classes might serve you.