Repository navigation
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.
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4