ResponseError.php 729 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /*
  3. * This file is part of the Predis package.
  4. *
  5. * (c) Daniele Alessandri <suppakilla@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Predis;
  11. class ResponseError implements IRedisServerError
  12. {
  13. private $_message;
  14. public function __construct($message)
  15. {
  16. $this->_message = $message;
  17. }
  18. public function getMessage()
  19. {
  20. return $this->_message;
  21. }
  22. public function getErrorType()
  23. {
  24. list($errorType, ) = explode(' ', $this->getMessage(), 2);
  25. return $errorType;
  26. }
  27. public function __toString()
  28. {
  29. return $this->getMessage();
  30. }
  31. }