1 | <?php |
||
19 | class NotAuthorizedException extends \OutOfBoundsException |
||
20 | { |
||
21 | const ERROR_RESPONSE = 'wamp.error.not_authorized'; |
||
22 | |||
23 | const DEFAULT_ERROR_MSG = 'session is not authorized'; |
||
24 | |||
25 | /** |
||
26 | * @var string name of the topic |
||
27 | */ |
||
28 | protected $topicName; |
||
29 | |||
30 | /** |
||
31 | * @param string $topicName |
||
32 | * @param string $errorMsg |
||
33 | */ |
||
34 | public function __construct($topicName, $errorMsg = self::DEFAULT_ERROR_MSG) |
||
40 | |||
41 | /** |
||
42 | * Checks if a router response is a 'no_such_topic' error. |
||
43 | * |
||
44 | * @param $errorResponse |
||
45 | * |
||
46 | * @return bool |
||
47 | */ |
||
48 | public static function isNotAuthrorizedError($errorResponse) |
||
52 | |||
53 | /** |
||
54 | * @return string the topic name |
||
55 | */ |
||
56 | public function getTopicName() |
||
60 | |||
61 | /** |
||
62 | * @param string $topicName |
||
63 | */ |
||
64 | protected function setTopicName($topicName) |
||
68 | } |
||
69 |