diff --git a/src/Symfony/Bundle/DebugBundle/Resources/config/services.xml b/src/Symfony/Bundle/DebugBundle/Resources/config/services.xml index 9cb70d08cc..49772b4696 100644 --- a/src/Symfony/Bundle/DebugBundle/Resources/config/services.xml +++ b/src/Symfony/Bundle/DebugBundle/Resources/config/services.xml @@ -96,7 +96,7 @@ - + diff --git a/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php b/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php index 841c772c32..03885a46b8 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php @@ -125,7 +125,11 @@ class DebugHandlersListener implements EventSubscriberInterface if ($output instanceof ConsoleOutputInterface) { $output = $output->getErrorOutput(); } - $this->exceptionHandler = function ($e) use ($app, $output) { + $this->exceptionHandler = static function (\Throwable $e) use ($app, $output) { + if (!$e instanceof \Exception) { + $e = new FatalThrowableError($e); + } + $app->renderException($e, $output); }; }