1 | <?php |
||
22 | class SocketExceptionEvent extends Event |
||
23 | { |
||
24 | /** |
||
25 | * Exception linked with event |
||
26 | * |
||
27 | * @var SocketException |
||
28 | */ |
||
29 | private $exception; |
||
30 | |||
31 | /** |
||
32 | * Constructor |
||
33 | * |
||
34 | * @param SocketException $exception Exception occurred during request |
||
35 | * @param RequestExecutorInterface $executor Request executor object |
||
36 | * @param SocketInterface $socket Socket for this request |
||
37 | * @param mixed $context Any optional user data for event |
||
38 | */ |
||
39 | 52 | public function __construct( |
|
40 | SocketException $exception, |
||
41 | RequestExecutorInterface $executor, |
||
42 | SocketInterface $socket, |
||
43 | $context |
||
44 | ) { |
||
45 | 52 | parent::__construct($executor, $socket, $context, EventType::EXCEPTION); |
|
46 | 52 | $this->exception = $exception; |
|
47 | 52 | } |
|
48 | |||
49 | /** |
||
50 | * Return thrown exception |
||
51 | * |
||
52 | * @return SocketException |
||
53 | */ |
||
54 | 13 | public function getException() |
|
58 | } |
||
59 |