ErrorEvent

Class
extends Exception
implements StoppableEventInterface
Final: Yes

Represent a listener failure as a dispatchable event.

Description

The dispatcher emits this event when a listener throws while handling another event.

Table of Contents

Interfaces

Properties

 : object
$listener

Listener that raised the throwable.

 : callable

Methods

__construct()

Create an error event from a failed listener invocation.

 : mixed
getEvent()

Get the original event that was being dispatched.

 : object
getListener()

Get the listener that raised the throwable.

 : callable
getThrowable()

Get the throwable that caused this error event.

 : Throwable
isPropagationStopped()

Determine whether propagation for this error event has been stopped.

 : bool
stopPropagation()

Mark this error event as stopped.

 : void
Properties

$event

Private Read-only
private object $event

$listener

Private

Listener that raised the throwable.

private callable $listener

$propagationStopped

Private
private bool $propagationStopped = false
Methods

__construct()

Public

Create an error event from a failed listener invocation.

public __construct( object  $event, callable  $listener, Throwable  $throwable[, bool  $propagationStopped = false]) : mixed
Parameters
$event : object

Description

original event being dispatched

$listener : callable

Description

listener that raised the throwable

$throwable : Throwable

Description

throwable raised by the listener

$propagationStopped : bool = false

Description

initial propagation state for this error event

getEvent()

Public

Get the original event that was being dispatched.

public getEvent() : object
Return values
object

Description

event instance associated with the listener failure

getListener()

Public

Get the listener that raised the throwable.

public getListener() : callable
Return values
callable

Description

listener associated with this error event

getThrowable()

Public

Get the throwable that caused this error event.

public getThrowable() : Throwable
Return values
Throwable

Description

throwable stored as the previous exception

isPropagationStopped()

Public

Determine whether propagation for this error event has been stopped.

public isPropagationStopped() : bool
Return values
bool

Description

whether propagation is currently stopped

stopPropagation()

Public

Mark this error event as stopped.

public stopPropagation() : void