File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,17 @@ event listeners, the ``ConsoleEvents::ERROR`` event is dispatched. A listener
9494can wrap or change the exception or do anything useful before the exception is
9595thrown by the application.
9696
97+ The ``ConsoleEvents::ERROR `` Event
98+ ----------------------------------
99+
100+ **Typical Purposes **: Handle exceptions thrown during the execution of a
101+ command.
102+
103+ Whenever an exception is thrown by a command, including those triggered from
104+ event listeners, the ``ConsoleEvents::ERROR `` event is dispatched. A listener
105+ can wrap or change the exception or do anything useful before the exception is
106+ thrown by the application.
107+
97108Listeners receive a
98109:class: `Symfony\\ Component\\ Console\\ Event\\ ConsoleErrorEvent ` event::
99110
@@ -111,7 +122,7 @@ Listeners receive a
111122 $exitCode = $event->getExitCode();
112123
113124 // changes the exception to another one
114- $event->setException (new \LogicException('Caught exception', $exitCode, $event->getError()));
125+ $event->setError (new \LogicException('Caught exception', $exitCode, $event->getError()));
115126 });
116127
117128The ``ConsoleEvents::TERMINATE `` Event
You can’t perform that action at this time.
0 commit comments