ExceptionCaughtEvent
Emitted by ErrorHandlingMiddleware whenever it catches an unhandled throwable, before rendering the error response.
Lets plugins hook error reporting (e.g. Sentry/Bugsnag) uniformly instead of each wiring its own constructor-injected callback.
Synopsis
Section titled “Synopsis”final class ExceptionCaughtEvent extends Event
| Extends | Event |
| Source | Event/Lifecycle/ExceptionCaughtEvent.php |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
$exception | Throwable | readonly. |
$request | ServerRequestInterface | readonly. |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(Throwable $exception, ServerRequestInterface $request): mixed
| Parameter | Type | Description |
|---|---|---|
$exception | Throwable | |
$request | ServerRequestInterface |
Returns mixed