File tree 1 file changed +12
-1
lines changed 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
94
94
can wrap or change the exception or do anything useful before the exception is
95
95
thrown by the application.
96
96
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
+
97
108
Listeners receive a
98
109
:class: `Symfony\\ Component\\ Console\\ Event\\ ConsoleErrorEvent ` event::
99
110
@@ -111,7 +122,7 @@ Listeners receive a
111
122
$exitCode = $event->getExitCode();
112
123
113
124
// 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()));
115
126
});
116
127
117
128
The ``ConsoleEvents::TERMINATE `` Event
You can’t perform that action at this time.
0 commit comments