diff --git a/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php b/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php index 2f523a54dbe4a..3b0567ff87d6a 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php @@ -103,6 +103,13 @@ public function configure(Event $event = null) } $this->exceptionHandler = function ($e) use ($app, $output) { $app->renderException($e, $output); + + if ($e instanceof \ErrorException) { + // CLI - do not display the error and trace twice + ini_set('display_errors', 0); + + throw $e; // Give back $exception to the native handler + } }; } }