Skip to content

Commit ad90ec7

Browse files
committed
feature #7733 Documented the new ConsoleEvents::ERROR event (javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Documented the new ConsoleEvents::ERROR event This fixes #7704. I propose to add this small section ... and refactor it in 3.4 to remove `Console::EXCEPTION` and move its description to the new `Console::ERROR`. Commits ------- ad2bb86 Documented the new ConsoleEvents::ERROR event
2 parents 52404c9 + ad2bb86 commit ad90ec7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

components/console/events.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ C/C++ standard.::
8686
The ``ConsoleEvents::EXCEPTION`` Event
8787
--------------------------------------
8888

89+
.. versionadded:: 3.3
90+
The ``ConsoleEvents::EXCEPTION`` event was deprecated in Symfony 3.3. Use
91+
the ``ConsoleEvents::ERROR`` event instead.
92+
8993
**Typical Purposes**: Handle exceptions thrown during the execution of a
9094
command.
9195

@@ -113,6 +117,19 @@ Listeners receive a
113117
$event->setException(new \LogicException('Caught exception', $exitCode, $event->getException()));
114118
});
115119

120+
The ``ConsoleEvents::ERROR`` Event
121+
----------------------------------
122+
123+
.. versionadded:: 3.3
124+
The ``ConsoleEvents::ERROR`` event was introduced in Symfony 3.3.
125+
126+
**Typical Purposes**: Handle exceptions thrown during the execution of a
127+
command.
128+
129+
This event is an improved version of the ``ConsoleEvents::EXCEPTION`` event,
130+
because it can handle every exception thrown during the execution of a command,
131+
including those triggered from event listeners.
132+
116133
The ``ConsoleEvents::TERMINATE`` Event
117134
--------------------------------------
118135

0 commit comments

Comments
 (0)