-
Notifications
You must be signed in to change notification settings - Fork 2
CriticalException
Viames Marino edited this page Feb 23, 2026
·
1 revision
Pair\Exceptions\CriticalException handles fatal framework/application failures.
__construct(string $message, int $code = 0, ?Throwable $previous = null):
- logs emergency-level error
- terminates app through
CriticalException::terminate(...)
- sets HTTP 500
- disables logger for env-file loading failures
- in headless mode: stops without rendering HTML
- in web mode: clears buffer, resolves fallback template, renders via
TemplateRenderer
Internal fallback search in templates:
500.phpdefault.php
If no template exists, execution stops with fatal message.
use Pair\Exceptions\CriticalException;
use Pair\Exceptions\ErrorCodes;
throw new CriticalException('Configuration file missing', ErrorCodes::LOADING_ENV_FILE);See also: PairException, TemplateRenderer, ErrorCodes.