Repository navigation
PairException
Viames Marino edited this page Sep 30, 2026
·
2 revisions
Pair\Exceptions\PairException is the base framework exception type.
__construct(string $message, int $code = 0, ?Throwable $previous = null):
- logs the previous exception message when present, otherwise the supplied message
- in Pair 4.1.1, logs
CSRF_TOKEN_NOT_FOUNDandCSRF_TOKEN_INVALIDatnoticelevel, preserving the error code in context; these expected session/token failures do not trigger error snapshots or email/Telegram alerts - logs other non-critical errors at
errorlevel - escalates to
CriticalExceptionfor critical error codes (DB connection/config/missing DB objects)
Behavior:
- a
Throwableis passed toLogger::exceptionHandler() - in production, the displayed message is replaced with translated generic error text
- outside production, throwable chains provide technical details and string messages use safe localization
- in headless mode -> JSON error response
- in web mode -> modal error notification
throw new \Pair\Exceptions\PairException('Invalid state', \Pair\Exceptions\ErrorCodes::GENERIC_ERROR);Many framework exceptions extend this class and inherit logging/escalation semantics.
See also: AppException, CriticalException, ApiException, AjaxException.
Maintained by Viames Marino — VM Ingegneria · Professional enquiries
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