Guides
Error Handling
Learn how to handle common errors when integrating POW Cards
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
Common causes:
- User hasn’t connected their wallet
- Wallet connection was lost
- Wallet adapter not properly initialized
Solution:
- Ensure the wallet connection UI is visible (
<WalletMultiButton />
) - Check wallet connection state before operations
- Implement auto-reconnect logic
Wallet Adapter Missing
Solution:
- Verify wallet adapter packages are installed
- Check wallet initialization in your provider setup
- Include all supported wallet adapters
Signature Errors
User Rejected Signature
Common causes:
- User declined the signature request
- Wallet popup was closed
- Transaction timed out
Solution:
- Provide clear instructions to users
- Handle rejection gracefully with retry option
- Show helpful error messages
API Errors
Network Errors
Common HTTP Status Codes:
400
- Bad Request (invalid parameters)401
- Unauthorized (invalid signature)429
- Too Many Requests (rate limit exceeded)500
- Server Error
Rate Limiting
Solution:
- 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" } |
Example error response type:
Error handling in the application:
For more details on API responses, see the API Reference.