Error Hierarchy
All Chipi SDK errors extend a baseChipiError class. Each error type carries specific context to help you handle failures precisely.
Type Guards
isChipiError(error)
Check if an error is any Chipi SDK error:
hasHttpStatus(error)
Check if an error has an HTTP status code. Useful for retry logic and status-specific handling:
Error Patterns by Type
API Errors
Session Errors
Session errors include a.code field for precise handling:
Session Error Codes Reference
| Code | Meaning | Recovery |
|---|---|---|
SESSION_EXPIRED | validUntil timestamp has passed | Create and register a new session |
SESSION_NOT_REGISTERED | Session key not found on-chain | Call addSessionKeyToContract |
SESSION_REVOKED | Session was explicitly revoked | Create a new session |
SESSION_MAX_CALLS_EXCEEDED | remainingCalls reached 0 | Create a new session with higher maxCalls |
SESSION_ENTRYPOINT_NOT_ALLOWED | Called function not in whitelist | Register with correct allowedEntrypoints |
SESSION_DECRYPTION_FAILED | Wrong PIN for session private key | Prompt user to re-enter PIN |
SESSION_CREATION_FAILED | Keypair generation error | Retry the operation |
SESSION_INVALID_RESPONSE | Malformed contract response | Check wallet type and contract state |
INVALID_WALLET_TYPE_FOR_SESSION | Wallet is READY, not CHIPI | Use a CHIPI wallet for sessions |
Wallet Errors
Auth Errors
Common Pattern: Unified Error Handler
Related
- Session Keys Guide - Full session key lifecycle
- Passkeys Guide - Biometric authentication
- Backend Methods - Server-side error handling
