| 1 | <?php |
||
| 22 | class RouteNotDefined extends \Exception implements Exception |
||
| 23 | { |
||
| 24 | use AccessorTrait; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | private $id; |
||
| 30 | |||
| 31 | protected function get_id() |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param string $id Identifier of the route. |
||
| 38 | * @param int $code |
||
| 39 | * @param \Exception $previous |
||
| 40 | */ |
||
| 41 | public function __construct($id, $code = Status::NOT_FOUND, \Exception $previous = null) |
||
| 42 | { |
||
| 43 | $this->id = $id; |
||
| 44 | |||
| 45 | parent::__construct($this->format_message($id), $code, $previous); |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Formats exception message. |
||
| 50 | * |
||
| 51 | * @param string $id |
||
| 52 | * |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | protected function format_message($id) |
||
| 59 | } |
||
| 60 |