@@ -48,22 +48,22 @@ public static function getSubscribedEvents(): array
4848     */ 
4949    public  function  onKernelException (ExceptionEvent $ eventvoid 
5050    {
51-         $ exception $ eventgetException ();
51+         $ throwable $ eventgetThrowable ();
5252
5353        if  (!$ this kernel ->isDebug () && $ eventgetRequest ()->isXmlHttpRequest ()) {
5454            $ responsenew  JsonResponse ([
5555                'ok '  => false ,
5656                'error '  => [
57-                     'message '  => $ exception getMessage (),
57+                     'message '  => $ throwable getMessage (),
5858                ],
5959            ]);
6060
6161            $ eventsetResponse ($ response
6262        }
6363
64-         if  ($ exception instanceof  AccessDeniedHttpException) {
65-             if  (preg_match ('/Access Denied by controller annotation @IsGranted\("(.+)"\)/ ' , $ exception getMessage (), $ matches
66-                 || preg_match ('/Access Denied by controller annotation @IsGranted\("(.+)", (.+)\)/ ' , $ exception getMessage (), $ matches
64+         if  ($ throwable instanceof  AccessDeniedHttpException) {
65+             if  (preg_match ('/Access Denied by controller annotation @IsGranted\("(.+)"\)/ ' , $ throwable getMessage (), $ matches
66+                 || preg_match ('/Access Denied by controller annotation @IsGranted\("(.+)", (.+)\)/ ' , $ throwable getMessage (), $ matches
6767            ) {
6868                $ redirectUrl$ this urlGenerator ->generate ('admin_access_denied ' , [
6969                    'rule '  => strtolower (explode ('| ' , $ matches1 ])[0 ]),
@@ -73,8 +73,8 @@ public function onKernelException(ExceptionEvent $event): void
7373            }
7474        }
7575
76-         if  ($ exception instanceof  NotFoundHttpException) {
77-             if  (preg_match ('/App:(\w+) object not found by the @ParamConverter annotation/ ' , $ exception getMessage (), $ matches
76+         if  ($ throwable instanceof  NotFoundHttpException) {
77+             if  (preg_match ('/App:(\w+) object not found by the @ParamConverter annotation/ ' , $ throwable getMessage (), $ matches
7878                $ redirectUrl$ this urlGenerator ->generate ('admin_missing_entity ' , [
7979                    'object '  => strtolower ($ matches1 ]),
8080                ]);
0 commit comments