File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/ErrorsBundle/Subscriber Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 22
33namespace Gamma \ErrorsBundle \Subscriber ;
44
5+ use App \Kernel ;
56use Gamma \ErrorsBundle \Debug \ErrorHandler ;
67use Symfony \Component \Console \ConsoleEvents ;
78use Symfony \Component \Console \Event \ConsoleExceptionEvent ;
@@ -35,11 +36,18 @@ public function __construct(ErrorHandler $errorHandler)
3536 */
3637 public static function getSubscribedEvents ()
3738 {
38- return [
39- KernelEvents::REQUEST => ['onRequest ' ],
39+ $ events = [
40+ KernelEvents::REQUEST => ['onRequest ' ],
4041 KernelEvents::EXCEPTION => ['onKernelException ' ],
41- ConsoleEvents::EXCEPTION => ['onConsoleException ' ],
4242 ];
43+
44+ if (Kernel::VERSION >= '3.3 ' ) {
45+ $ events [ConsoleEvents::ERROR ] = ['onConsoleException ' ];
46+ } else {
47+ $ events [ConsoleEvents::EXCEPTION ] = ['onConsoleException ' ];
48+ }
49+
50+ return $ events ;
4351 }
4452
4553 /**
You can’t perform that action at this time.
0 commit comments