Repository navigation
ErrorCodes
Pair\Exceptions\ErrorCodes contains framework error code constants used across exceptions and logs.
Use constants when throwing Pair exceptions so logs and handling rules are consistent.
use Pair\Exceptions\ErrorCodes;
use Pair\Exceptions\PairException;
throw new PairException('DB query failed', ErrorCodes::DB_QUERY_FAILED);Some codes are treated as critical and can escalate to CriticalException.
This keeps error-handling behavior deterministic across framework layers.
- choose the most specific code available
- avoid magic numbers in throws/replies
- keep application-specific codes separate from framework-level constants
Integration-specific constants include errors such as STRIPE_ERROR, GOOGLE_MAPS_ERROR, WHATSAPP_ERROR, OPENAI_ERROR, GEMINI_ERROR, CLAUDE_ERROR, RESEND_ERROR, SOCIAL_AUTH_ERROR, CLOUDFLARE_TURNSTILE_ERROR, GOOGLE_RECAPTCHA_ERROR, HUMAN_CHALLENGE_ERROR, MEILISEARCH_ERROR, SENTRY_ERROR, OPENTELEMETRY_ERROR, and SUPABASE_ERROR.
See also: PairException, CriticalException, AppException, ApiException.
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