Class Symfony\Component\Console\Event\ConsoleExceptionEvent

InheritanceSymfony\Component\Console\Event\ConsoleExceptionEvent » Symfony\Component\Console\Event\ConsoleEvent » Symfony\Component\EventDispatcher\Event

Allows to handle exception thrown in a command.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$command Symfony\Component\Console\Event\ConsoleEvent

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Symfony\Component\Console\Event\ConsoleExceptionEvent
getCommand() Gets the command that is executed. Symfony\Component\Console\Event\ConsoleEvent
getDispatcher() Returns the EventDispatcher that dispatches this Event. Symfony\Component\EventDispatcher\Event
getException() Returns the thrown exception. Symfony\Component\Console\Event\ConsoleExceptionEvent
getExitCode() Gets the exit code. Symfony\Component\Console\Event\ConsoleExceptionEvent
getInput() Gets the input instance. Symfony\Component\Console\Event\ConsoleEvent
getName() Gets the event's name. Symfony\Component\EventDispatcher\Event
getOutput() Gets the output instance. Symfony\Component\Console\Event\ConsoleEvent
isPropagationStopped() Returns whether further event listeners should be triggered. Symfony\Component\EventDispatcher\Event
setDispatcher() Stores the EventDispatcher that dispatches this Event. Symfony\Component\EventDispatcher\Event
setException() Replaces the thrown exception. Symfony\Component\Console\Event\ConsoleExceptionEvent
setName() Sets the event's name property. Symfony\Component\EventDispatcher\Event
stopPropagation() Stops the propagation of the event to further event listeners. Symfony\Component\EventDispatcher\Event

Method Details

__construct() public method

public void __construct ( Symfony\Component\Console\Command\Command $command, Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, Exception $exception, $exitCode )
$command
$input
$output
$exception
$exitCode
getException() public method

Returns the thrown exception.

public Exception getException ( )
return Exception

The thrown exception

getExitCode() public method

Gets the exit code.

public int getExitCode ( )
return int

The command exit code

setException() public method

Replaces the thrown exception.

This exception will be thrown if no response is set in the event.

public void setException ( Exception $exception )
$exception Exception

The thrown exception