PanelFailure
API reference › Debug Core › Storage › PanelFailure
Captures a panel failure without invalidating the remaining request snapshot.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$exception readonly constructor | ExceptionSnapshot | Captured panel exception. | PanelFailure |
$stage readonly constructor | "capture"| | Lifecycle stage the panel failed in. | PanelFailure |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a panel failure record. | PanelFailure |
fromArray() static | Hydrates a panel failure from decoded JSON data. | PanelFailure |
fromThrowable() static | Captures a throwable raised during a panel lifecycle stage. | PanelFailure |
jsonSerialize() | Returns the failure record for JSON serialization. | PanelFailure |
Constants
Section titled “Constants”| Constant | Value | Description | Defined by |
|---|---|---|---|
CAPTURE | 'capture' | Lifecycle stage indicating the panel was captured. | PanelFailure |
HYDRATE | 'hydrate' | Lifecycle stage indicating the panel was hydrated. | PanelFailure |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct("capture"|"hydrate" $stage, PHPForge\Debug\Storage\ExceptionSnapshot $exception)Creates a panel failure record.
Parameters
| Parameter | Type | Description |
|---|---|---|
$stage | "capture"| | Lifecycle stage the panel failed in. |
$exception | ExceptionSnapshot | Captured panel exception. |
fromArray()
Section titled “fromArray() ”public static function fromArray(mixed $data, string $path): selfHydrates a panel failure from decoded JSON data.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | Decoded panel failure payload. |
$path | string | Payload path used in hydration errors. |
Returns
self: Hydrated panel failure.
fromThrowable()
Section titled “fromThrowable() ”public static function fromThrowable("capture"|"hydrate" $stage, Throwable $throwable): selfCaptures a throwable raised during a panel lifecycle stage.
Parameters
| Parameter | Type | Description |
|---|---|---|
$stage | "capture"| | Lifecycle stage the panel failed in. |
$throwable | Throwable | Panel exception to capture. |
Returns
self: Captured panel failure.
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array<string, mixed>Returns the failure record for JSON serialization.
Returns
array<string, mixed>: Serialized failure stage and exception.