Skip to content

ErrorEvent

github-actions edited this page Apr 6, 2026 · 1 revision

Represent a listener failure as a dispatchable event.

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


  • Full name: \FastForward\EventDispatcher\Event\ErrorEvent
  • Parent class: Exception
  • This class is marked as final and can't be subclassed
  • This class implements: StoppableEventInterface
  • This class is a Final class

Methods

__construct

Create an error event from a failed listener invocation.

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

Parameters:

Parameter Type Description
$event object original event being dispatched
$listener callable listener that raised the throwable
$throwable \Throwable throwable raised by the listener
$propagationStopped bool initial propagation state for this error event

isPropagationStopped

Determine whether propagation for this error event has been stopped.

public isPropagationStopped(): bool

Return Value:

whether propagation is currently stopped


stopPropagation

Mark this error event as stopped.

public stopPropagation(): void

getEvent

Get the original event that was being dispatched.

public getEvent(): object

Return Value:

event instance associated with the listener failure


getListener

Get the listener that raised the throwable.

public getListener(): callable

Return Value:

listener associated with this error event


getThrowable

Get the throwable that caused this error event.

public getThrowable(): \Throwable

Return Value:

throwable stored as the previous exception


Clone this wiki locally