Skip to content

Documented the new ConsoleEvents::ERROR event #7733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions components/console/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ C/C++ standard.::
The ``ConsoleEvents::EXCEPTION`` Event
--------------------------------------

.. versionadded:: 3.3
The ``ConsoleEvents::EXCEPTION`` event was deprecated in Symfony 3.3. Use
the ``ConsoleEvents::ERROR`` event instead.

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

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

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

.. versionadded:: 3.3
The ``ConsoleEvents::ERROR`` event was introduced in Symfony 3.3.

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

This event is an improved version of the ``ConsoleEvents::EXCEPTION`` event,
because it can handle every exception thrown during the execution of a command,
including those triggered from event listeners.

The ``ConsoleEvents::TERMINATE`` Event
--------------------------------------

Expand Down