@@ -62,26 +62,14 @@ public function onKernelException(ExceptionEvent $event, string $eventName = nul
6262 parent ::onKernelException ($ event );
6363 }
6464
65- /**
66- * @return Response
67- */
68- public function showExceptionPageAction (FlattenException $ exception )
65+ public function showExceptionPageAction (FlattenException $ exception ): Response
6966 {
70- $ entityConfig = isset ($ this ->easyAdminConfig ['entities ' ][$ this ->currentEntityName ])
71- ? $ this ->easyAdminConfig ['entities ' ][$ this ->currentEntityName ] : null ;
72- $ exceptionTemplatePath = isset ($ entityConfig ['templates ' ]['exception ' ])
73- ? $ entityConfig ['templates ' ]['exception ' ]
74- : (
75- isset ($ this ->easyAdminConfig ['design ' ]['templates ' ]['exception ' ])
76- ? $ this ->easyAdminConfig ['design ' ]['templates ' ]['exception ' ]
77- : '@EasyAdmin/default/exception.html.twig '
67+ $ entityConfig = $ this ->easyAdminConfig ['entities ' ][$ this ->currentEntityName ] ?? null ;
68+ $ exceptionTemplatePath = $ entityConfig ['templates ' ]['exception ' ] ?? (
69+ $ this ->easyAdminConfig ['design ' ]['templates ' ]['exception ' ] ?? '@EasyAdmin/default/exception.html.twig '
7870 );
79- $ exceptionLayoutTemplatePath = isset ($ entityConfig ['templates ' ]['layout ' ])
80- ? $ entityConfig ['templates ' ]['layout ' ]
81- : (
82- isset ($ this ->easyAdminConfig ['design ' ]['templates ' ]['layout ' ])
83- ? $ this ->easyAdminConfig ['design ' ]['templates ' ]['layout ' ]
84- : '@EasyAdmin/default/layout.html.twig '
71+ $ exceptionLayoutTemplatePath = $ entityConfig ['templates ' ]['layout ' ] ?? (
72+ $ this ->easyAdminConfig ['design ' ]['templates ' ]['layout ' ] ?? '@EasyAdmin/default/layout.html.twig '
8573 );
8674
8775 return new Response ($ this ->twig ->render ($ exceptionTemplatePath , [
@@ -90,7 +78,7 @@ public function showExceptionPageAction(FlattenException $exception)
9078 ]), $ exception ->getStatusCode ());
9179 }
9280
93- protected function logException (Throwable $ exception , string $ message ): void
81+ protected function logException (Throwable $ exception , string $ message, string $ logLevel = null ): void
9482 {
9583 if (!$ exception instanceof BaseException) {
9684 parent ::logException ($ exception , $ message );
0 commit comments