From ad2bb86ff2a5c8ee1a6eb032bac046f965c56c9a Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 31 Mar 2017 16:09:45 +0200 Subject: [PATCH] Documented the new ConsoleEvents::ERROR event --- components/console/events.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/components/console/events.rst b/components/console/events.rst index 69f451c1fe9..ad268bba0fd 100644 --- a/components/console/events.rst +++ b/components/console/events.rst @@ -86,6 +86,10 @@ C/C++ standard.:: The ``ConsoleEvents::EXCEPTION`` Event -------------------------------------- +.. versionadded:: 3.3 + The ``ConsoleEvents::EXCEPTION`` event was deprecated in Symfony 3.3. Use + the ``ConsoleEvents::ERROR`` event instead. + **Typical Purposes**: Handle exceptions thrown during the execution of a command. @@ -113,6 +117,19 @@ Listeners receive a $event->setException(new \LogicException('Caught exception', $exitCode, $event->getException())); }); +The ``ConsoleEvents::ERROR`` Event +---------------------------------- + +.. versionadded:: 3.3 + The ``ConsoleEvents::ERROR`` event was introduced in Symfony 3.3. + +**Typical Purposes**: Handle exceptions thrown during the execution of a +command. + +This event is an improved version of the ``ConsoleEvents::EXCEPTION`` event, +because it can handle every exception thrown during the execution of a command, +including those triggered from event listeners. + The ``ConsoleEvents::TERMINATE`` Event --------------------------------------