1 | <?php |
||
18 | class AirbrakeExceptionListener |
||
19 | { |
||
20 | /** |
||
21 | * Whether or not the listener is enabled. |
||
22 | * |
||
23 | * @var bool |
||
24 | */ |
||
25 | protected $listenerEnabled; |
||
26 | |||
27 | /** |
||
28 | * @var AirbrakeService |
||
29 | */ |
||
30 | protected $airbrakeService; |
||
31 | |||
32 | /** |
||
33 | * AirbrakeExceptionListener constructor. |
||
34 | * |
||
35 | * @param bool $listenerEnabled |
||
36 | * @param AirbrakeService $airbrakeService |
||
37 | */ |
||
38 | 4 | public function __construct($listenerEnabled, AirbrakeService $airbrakeService) |
|
43 | |||
44 | /** |
||
45 | * Handled on a kernel exceptions. |
||
46 | * |
||
47 | * @param GetResponseForExceptionEvent $exceptionEvent |
||
48 | */ |
||
49 | 2 | public function onKernelException(GetResponseForExceptionEvent $exceptionEvent) |
|
53 | |||
54 | /** |
||
55 | * Handled on console exceptions. |
||
56 | * |
||
57 | * @param ConsoleExceptionEvent $exceptionEvent |
||
58 | */ |
||
59 | 2 | public function onConsoleException(ConsoleExceptionEvent $exceptionEvent) |
|
63 | |||
64 | /** |
||
65 | * Unify the workflows for kernel and console exceptions. |
||
66 | * |
||
67 | * @param \Exception $exception |
||
68 | */ |
||
69 | 4 | protected function handleNotificationToAirbreakIfApplicable($exception) |
|
75 | } |
||
76 |