소스 검색

Fix server errors handling in Predis\Protocols\FastTextProtocol.

Daniele Alessandri 14 년 전
부모
커밋
74145ce45c
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      lib/addons/FastTextProtocol.php

+ 3 - 2
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(