Error Handling Guide
This guide covers common errors you might encounter when integrating POW Cards and how to handle them effectively.Wallet Connection Errors
Wallet Not Connected
- User hasn’t connected their wallet
- Wallet connection was lost
- Wallet adapter not properly initialized
- Ensure the wallet connection UI is visible (
<WalletMultiButton />
) - Check wallet connection state before operations
- Implement auto-reconnect logic
Wallet Adapter Missing
- Verify wallet adapter packages are installed
- Check wallet initialization in your provider setup
- Include all supported wallet adapters
Signature Errors
User Rejected Signature
- User declined the signature request
- Wallet popup was closed
- Transaction timed out
- Provide clear instructions to users
- Handle rejection gracefully with retry option
- Show helpful error messages
API Errors
Network Errors
400
- Bad Request (invalid parameters)401
- Unauthorized (invalid signature)429
- Too Many Requests (rate limit exceeded)500
- Server Error
Rate Limiting
- Implement exponential backoff
- Respect rate limits
- Show appropriate waiting messages
Best Practices
1. Graceful Error Recovery
2. User-Friendly Messages
3. Loading States
API Response Errors
The API returns standard HTTP status codes along with detailed error messages:HTTP Status | Description | Example Response |
---|---|---|
400 | Bad Request - Invalid parameters or message format | { "error": "Invalid parameters", "details": "Missing signature" } |
401 | Unauthorized - Invalid signature | { "error": "Unauthorized", "details": "Invalid signature" } |
429 | Too Many Requests - Rate limit exceeded | { "error": "Rate limit exceeded", "details": "Please try again in 60 seconds" } |
500 | Server Error - Internal server error | { "error": "Internal server error" } |