ErrorEvent
in package
Dispatcher-synthetic event raised when a registered Telegram handler throws an exception that isn't an internal signalling marker (`SkipHandler` / `CancelHandler`). Mirrors aiogram's `aiogram.types.error_event.ErrorEvent`.
Built by ErrorsMiddleware from the offending Update and the original
Throwable, then forwarded to the dispatcher's errors observer so that
registered error handlers can claim the failure (returning a substitute
value), inspect it, or fall through and let the exception re-raise.
This class is hand-authored — it is not produced by the Phase 2 codegen
because the schema doesn't describe it (ErrorEvent exists only in the
dispatcher domain, not in the Telegram Bot API wire format). To keep
make regenerate from clobbering this file, the relative path
Types/ErrorEvent.php is listed in
\Gruven\PhpBotGram\Generator\FileEmitter::PROTECTED_PATHS.
Differences from upstream:
exceptionis typed asThrowablerather thanException. PHP'sErrorhierarchy (e.g.TypeError,DivisionByZeroError) flows through the sametry/catch (Throwable)path inErrorsMiddleware, so the value object must accept both branches of the standard interface.- The class extends nothing — upstream's
ErrorEventextendsTelegramObjectfor pydantic serialisation, but ourTelegramObjectcarriesBotplumbing that doesn't apply to a dispatcher-synthetic event. KeepingErrorEventas a standalone readonly value object avoids leakingBotContextControllersemantics into the error pipeline.
Table of Contents
Properties
- $exception : Throwable
- $update : Update
Methods
- __construct() : mixed
Properties
$exception
public
Throwable
$exception
$update
public
Update
$update
Methods
__construct()
public
__construct(Update $update, Throwable $exception) : mixed
Parameters
- $update : Update
- $exception : Throwable