APIError class for all error handling across deposit, withdrawal, and display operations.
Import
APIError Class
Usage
Common Error Scenarios
Initialization
| Error Message Pattern | Description | Resolution |
|---|---|---|
"API key cannot be empty" | Empty or missing API key | Provide a valid pxl_... key |
"Invalid API key format" | Key doesn’t meet minimum length | Check key format |
"SDK not initialized" | SDK function called before initAmplifySDK() | Call initAmplifySDK() at app startup |
Deposits
| Error Message Pattern | Description | Resolution |
|---|---|---|
"No vault found for token..." | No vault matches yieldType, token, and chainId | Verify parameters with fetchSupportedAssets() |
"Token does not support EIP-2612 permit" | Token lacks permit support | Use approval flow or forceMethod: "approval" |
"Invalid slippage value" | Slippage outside 0–10000 bps | Provide value between 0 and 10000 |
Withdrawals
| Error Message Pattern | Description | Resolution |
|---|---|---|
"No vault found for asset..." | No vault matches parameters | Verify yieldType, wantAsset, and chainId |
"WithdrawQueue contract address not configured" | Vault missing queue address | Contact support — vault may not support withdrawals yet |
"Failed to check withdrawal approval" | On-chain multicall failed | Check RPC connectivity and retry |
Error Handling Patterns
Basic Error Handling
Logging Errors
User-Friendly Messages
Related
- Troubleshooting - Common issues and solutions
- Logging Guide - Debug logging configuration