Repository navigation
ApiException
Viames Marino edited this page Feb 23, 2026
·
1 revision
Pair\Exceptions\ApiException is specialized for API request error handling.
__construct(string $message, int $code = 0, ?Throwable $previous = null):
- logs error message (prefers previous exception message when available)
- keeps API-oriented exception semantics from
PairExceptionhierarchy
- in production, replaces message with translated generic message
- sends JSON error response
use Pair\Exceptions\ApiException;
if (!$token) {
ApiException::reply('Missing token', 1001, 401);
}See also: AjaxException, PairException, API.
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