File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -300,12 +300,17 @@ public function exceptionHandler(Throwable $exception): void
300300 }
301301 // @codeCoverageIgnoreEnd
302302
303+ echo $ this ->renderHtmlException ($ exception );
304+ }
305+
306+ public function renderHtmlException (Throwable $ exception ): string
307+ {
303308 $ ajax = (isset ($ _SERVER ) && isset ($ _SERVER ['X_REQUESTED_WITH ' ]) && 'XMLHttpRequest ' === $ _SERVER ['X_REQUESTED_WITH ' ]);
304309 $ output = '' ;
305310 if (! $ ajax ) {
306- $ output .= '<!DOCTYPE html><html><head><title>500: Errore interno </title></head><body> ' ;
311+ $ output .= '<!DOCTYPE html><html><head><title>500: Internal Server Error </title></head><body> ' ;
307312 }
308- $ output .= '<h1>500: Errore interno </h1> ' ;
313+ $ output .= '<h1>500: Internal Server Error </h1> ' ;
309314 $ output .= \PHP_EOL ;
310315 if ($ this ->displayErrors ()) {
311316 $ currentEx = $ exception ;
@@ -333,7 +338,7 @@ public function exceptionHandler(Throwable $exception): void
333338 $ output .= '</body></html> ' ;
334339 }
335340
336- echo $ output ;
341+ return $ output ;
337342 }
338343
339344 private function outputError (string $ text ): void
You can’t perform that action at this time.
0 commit comments