Commit | Line | Data |
---|---|---|
132ec342 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
41498ac5 | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
132ec342 | 5 | | | |
41498ac5 TO |
6 | | This work is published under the GNU AGPLv3 license with some | |
7 | | permitted exceptions and without any warranty. For full license | | |
8 | | and copyright information, see https://civicrm.org/licensing | | |
132ec342 | 9 | +--------------------------------------------------------------------+ |
d25dd0ee | 10 | */ |
132ec342 TO |
11 | |
12 | namespace Civi\API\Event; | |
13 | ||
6550386a EM |
14 | /** |
15 | * Class ExceptionEvent | |
16 | * @package Civi\API\Event | |
17 | */ | |
132ec342 TO |
18 | class ExceptionEvent extends Event { |
19 | ||
20 | /** | |
21 | * @var \Exception | |
22 | */ | |
23 | private $exception; | |
24 | ||
6550386a | 25 | /** |
8882ff5c TO |
26 | * @param \Exception $exception |
27 | * The exception which arose while processing the API request. | |
28 | * @param \Civi\API\Provider\ProviderInterface $apiProvider | |
29 | * The API provider responsible for executing the request. | |
30 | * @param array $apiRequest | |
31 | * The full description of the API request. | |
c98e9ee3 TO |
32 | * @param \Civi\API\Kernel $apiKernel |
33 | * The kernel which fired the event. | |
6550386a | 34 | */ |
c98e9ee3 | 35 | public function __construct($exception, $apiProvider, $apiRequest, $apiKernel) { |
132ec342 | 36 | $this->exception = $exception; |
c98e9ee3 | 37 | parent::__construct($apiProvider, $apiRequest, $apiKernel); |
132ec342 TO |
38 | } |
39 | ||
40 | /** | |
41 | * @return \Exception | |
42 | */ | |
43 | public function getException() { | |
44 | return $this->exception; | |
45 | } | |
96025800 | 46 | |
132ec342 | 47 | } |