Repository navigation
Internals Exception ExceptionBase
Framework Internals · Subsystem overview · Developer guide
Source: awt_src/classes/exception/ExceptionBase.php · Snapshot 8411f4287706.
Framework exception wrappers retain the previous Throwable and attach the current context when available. Installed boot registers CLI/web renderers.
use context\Context;
use context\events\GetContextEvent;abstract class ExceptionBase extends \ExceptionDeclarations below preserve visibility, type, default and modifiers exactly. A typed property without an initializer remains uninitialized until its constructor or another method assigns it. Mutable fields belong to this instance unless marked static; readonly fields can be initialized once. Constructor-promoted properties are also listed below.
| Member | Declaration | Purpose or source contract |
|---|---|---|
| $context | public Context $context; |
Used by __construct(). |
| $event | private GetContextEvent $event; |
Used by __construct(). |
| Constructor-promoted | public function __construct(?\Throwable $previous = null) |
Initialized from the constructor argument; default expression is evaluated when the argument is omitted. |
| Method | Signature |
|---|---|
| __construct | public function __construct(?\Throwable $previous = null) |
| buildMessage | abstract public function buildMessage(): string |
public function __construct(?\Throwable $previous = null)| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$previous |
?\Throwable $previous = null |
Operation input; the exact use, validation and propagation are shown in the implementation trace. |
State writes: $this->event, $this->context.
Implementation, validation guards and interaction order
public function __construct(?\Throwable $previous = null)
{
global $eventDispatcher;
$this->event = new GetContextEvent();
$this->context = new Context("", "System", "/");
$this->event->setContext($this->context);
if ($eventDispatcher instanceof \event\EventDispatcher) $eventDispatcher->dispatch($this->event);
$this->context = $this->event->getContext();
$message = $this->buildMessage();
if ($previous) {
$message .= "\nCaused by: " . $previous->getMessage();
}
parent::__construct($message, 0, $previous);
}abstract public function buildMessage(): string;Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.
AWT Framework Wiki · Home · Installation Guide · Developer Guide · Framework Internals
Philosophy · Architecture · Known discrepancies · Verification
Installation Guide
Developer Guide
- Learning sequence
- First package
- Package structure
- Lifecycle
- Runtimes
- Events and objects
- Routing and controllers
- Views and resources
- Database and models
- Storage and caching
- Configuration and CLI
- Responses and errors
- Extension points
Framework Internals
- Architecture
- Bootstrap
- Packages
- Runtime
- Events and context
- Objects
- HTTP routing and controllers
- Rendering
- Blade integration
- Database
- Models
- Storage and caching
- Settings
- CLI
- Identity and sessions
- Responses
- Errors
- Complete source inventory
Documentation notes