Error Handling
Handle errors, configure retries, and set timeouts when working with Cascade storage.
Common Errors
These are the errors you will most likely run into when building with Cascade.
RPC Connection Errors
If the Lumera RPC node is down or unreachable, client creation and blockchain transactions will fail:
Fix: Switch to a different RPC endpoint, or wait and retry. You can pass a custom endpoint instead of the preset:
Insufficient Funds
Uploading requires LUME tokens to pay the action fee. If your wallet is empty:
Fix: Fund your wallet with testnet tokens from the Lumera faucet before uploading.
Keplr Extension Not Found
The user hasn't installed Keplr or the page loaded before the extension injected window.keplr.
Fix: Wait for the extension to load before accessing it:
Wallet Popup Rejected
When using Keplr or Leap, the user must approve signature requests. If they click "Reject":
Fix: Prompt the user to try again and approve the wallet popup. Cascade requires ADR-036 signatures for authentication, not transactions. Consider showing a pre-sign dialog explaining what is being signed. The user may see multiple popups during upload (layout, index, and auth).
Supernodes Unavailable
If no supernodes are online to handle your request:
Fix: Wait a few minutes and retry. This usually means the testnet supernodes are temporarily down or overloaded.
Upload Timeout
Large files or slow networks can cause the task to exceed the default 5-minute timeout:
Fix: Increase the timeout in taskOptions:
Action Not Registered
The transaction went through but the SDK could not find the action_registered event in the response:
This usually means you are trying to upload too fast after creating the client, or the transaction failed silently on-chain.
Fix:
- Add a short delay before uploading to let the chain finalize the transaction
- Check that your transaction actually succeeded on the Explorer
- Make sure you have enough funds to cover the action fee (the transaction may have failed due to insufficient gas)
Action Not Found (404 from SN-API)
The on-chain action was registered, but the Supernode hasn't indexed it yet, or the Action ID is invalid.
Fix: The SDK retries automatically (5 attempts, 3-second delays). If the issue persists:
- Verify the action exists on-chain at
https://portal.testnet.lumera.io - Increase the timeout in
taskOptions - Try a different SN-API endpoint
Download Failed or Empty Stream
The Supernodes could not reconstruct the file. This can happen with very recent uploads (Supernodes are still processing) or if the action has expired.
Fix:
- Wait a few minutes after upload before attempting download
- Verify the action status:
client.Blockchain.Action.getAction(actionId) - Check that
state === "ACTION_STATE_DONE"
Private File Access Denied
Trying to download a private file from a wallet that did not upload it:
Fix: Only the wallet that uploaded the file can download it when isPublic: false. Make sure you are connected with the correct wallet.
Built-in Retries
The SDK automatically retries failed HTTP requests with exponential backoff. The defaults are:
| Setting | Default |
|---|---|
| Max attempts | 3 |
| Initial delay | 1000ms |
| Max delay | 30000ms |
| Backoff multiplier | 2x |
| Retryable status codes | 408, 429, 500, 502, 503, 504 |
You can override these when creating the client:
File uploads and downloads skip automatic retries because the request body or response stream can only be consumed once. The SDK retries everything else (status checks, metadata queries, etc.) automatically.
Task Options
Upload and download tasks are processed asynchronously by supernodes. The SDK polls for status until the task completes. You can tune this behavior:
If an upload times out, the task may still be processing on the supernode. Do not retry immediately or you may create a duplicate action on-chain.
Getting Help
- Discord: discord.com/invite/qudewKS3kp
- GitHub Issues: LumeraProtocol/sdk-js/issues
- Explorer: portal.testnet.lumera.io