From 74145ce45c7a7000cbe77dcf9186f7c6a3df015b Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Wed, 12 Jan 2011 18:31:54 +0100 Subject: [PATCH] Fix server errors handling in Predis\Protocols\FastTextProtocol. --- lib/addons/FastTextProtocol.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/addons/FastTextProtocol.php b/lib/addons/FastTextProtocol.php index ac99e2e9..fe5f96b3 100644 --- a/lib/addons/FastTextProtocol.php +++ b/lib/addons/FastTextProtocol.php @@ -113,10 +113,11 @@ class FastTextProtocol implements IRedisProtocol { return (int) $payload; case '-': // error + $errorMessage = substr($payload, 4); if ($this->_throwErrors) { - throw new Exception($payload); + throw new \Predis\ServerException($errorMessage); } - return new Predis\ResponseError($payload); + return new \Predis\ResponseError($errorMessage); default: throw new CommunicationException(