Skip to content

Commit

Permalink
Merge branch '4.2'
Browse files Browse the repository at this point in the history
* 4.2:
  use .yaml instead of .yml
  Fix console error event
  • Loading branch information
javiereguiluz committed Dec 27, 2018
2 parents 491c558 + daca1d9 commit 6e6d126
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion components/console/events.rst
Expand Up @@ -94,6 +94,17 @@ event listeners, the ``ConsoleEvents::ERROR`` event is dispatched. A listener
can wrap or change the exception or do anything useful before the exception is
thrown by the application.

The ``ConsoleEvents::ERROR`` Event
----------------------------------

**Typical Purposes**: Handle exceptions thrown during the execution of a
command.

Whenever an exception is thrown by a command, including those triggered from
event listeners, the ``ConsoleEvents::ERROR`` event is dispatched. A listener
can wrap or change the exception or do anything useful before the exception is
thrown by the application.

Listeners receive a
:class:`Symfony\\Component\\Console\\Event\\ConsoleErrorEvent` event::

Expand All @@ -111,7 +122,7 @@ Listeners receive a
$exitCode = $event->getExitCode();

// changes the exception to another one
$event->setException(new \LogicException('Caught exception', $exitCode, $event->getError()));
$event->setError(new \LogicException('Caught exception', $exitCode, $event->getError()));
});

The ``ConsoleEvents::TERMINATE`` Event
Expand Down
2 changes: 1 addition & 1 deletion form/form_collections.rst
Expand Up @@ -474,7 +474,7 @@ you will learn about next!).
.. code-block:: yaml
# src/Resources/config/doctrine/Task.orm.yml
# src/Resources/config/doctrine/Task.orm.yaml
App\Entity\Task:
type: entity
# ...
Expand Down

0 comments on commit 6e6d126

Please sign in to comment.