Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6e6d126

Browse files
committed
Merge branch '4.2'
* 4.2: use .yaml instead of .yml Fix console error event
2 parents 491c558 + daca1d9 commit 6e6d126

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

components/console/events.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ event listeners, the ``ConsoleEvents::ERROR`` event is dispatched. A listener
9494
can wrap or change the exception or do anything useful before the exception is
9595
thrown 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+
97108
Listeners 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

117128
The ``ConsoleEvents::TERMINATE`` Event

form/form_collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ you will learn about next!).
474474
475475
.. code-block:: yaml
476476
477-
# src/Resources/config/doctrine/Task.orm.yml
477+
# src/Resources/config/doctrine/Task.orm.yaml
478478
App\Entity\Task:
479479
type: entity
480480
# ...

0 commit comments

Comments
 (0)