Total Complexity | 3 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
16 | class RequestErrorException extends Exception |
||
17 | { |
||
18 | /** |
||
19 | * @var RequestInterface |
||
20 | */ |
||
21 | protected $request; |
||
22 | |||
23 | /** |
||
24 | * RequestErrorException constructor. |
||
25 | * |
||
26 | * @param string $message |
||
27 | * @param RequestInterface $request |
||
28 | * @param int $code |
||
29 | * @param \Exception|null $previous |
||
30 | */ |
||
31 | public function __construct($message, RequestInterface $request, $code = 0, \Exception $previous = null) |
||
32 | { |
||
33 | $this->request = $request; |
||
34 | parent::__construct($message, $this->getErrorInfo(), $code, $previous); |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @return RequestInterface |
||
39 | */ |
||
40 | public function getRequest() |
||
41 | { |
||
42 | return $this->errorInfo['request']; |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @return array |
||
47 | */ |
||
48 | protected function getErrorInfo() |
||
56 | ]; |
||
57 | } |
||
58 | } |
||
59 |