Debian Codegraph @

vendor/clue/redis-protocol/src/Model/ErrorReply.php

raw
1 <?php
2
3 namespace Clue\Redis\Protocol\Model;
4
5 use Clue\Redis\Protocol\Serializer\SerializerInterface;
6 use Exception;
7
8 /**
9 *
10 * @link http://redis.io/topics/protocol#status-reply
11 */
12 class ErrorReply extends Exception implements ModelInterface
13 {
14 /**
15 * create error status reply (single line error message)
16 *
17 * @param string $message
18 * @return string
19 */
20 public function __construct($message, $code = 0, $previous = null)
21 {
22 parent::__construct($message, $code, $previous);
23 }
24
25 public function getValueNative()
26 {
27 return $this->getMessage();
28 }
29
30 public function getMessageSerialized(SerializerInterface $serializer)
31 {
32 return $serializer->getErrorMessage($this->getMessage());
33 }
34 }