Fix server errors handling in Predis\Protocols\FastTextProtocol.

This commit is contained in:
Daniele Alessandri
2011-01-12 18:31:54 +01:00
parent 898b038f48
commit 74145ce45c
+3 -2
View File
@@ -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(