Error Codes
This guide explains execution statuses and error classifications in Bridgfy, helping you understand and handle failed transactions in your integration.Execution Statuses
Every execution moves through a lifecycle with specific statuses. Understanding these statuses is critical for building a robust integration.Status Overview
| Status | Type | Retryable | Description |
|---|---|---|---|
PENDING | Active | N/A | Route resolved, preparing to execute |
RUNNING | Active | N/A | Transaction submitted to network |
SUCCESS | Terminal | No | Transaction confirmed on-chain |
FAILED | Active | Maybe | Execution failed, may be retried automatically |
DEAD_LETTER | Terminal | No | Terminal failure, no more retries |
TOKEN_BLACKLISTED | Terminal | No | Token is on security blacklist |
FAILED_UNROUTABLE_MAIN | Terminal | No | No valid route found |
FAILED_INVALID_INPUT | Terminal | No | Invalid request parameters |
FAILED_NO_FUNDS | Terminal | No | Insufficient balance in account |
FAILED_INSUFFICIENT_AFTER_FEES | Terminal | No | Fees exceed deposit amount |
QUOTA_EXCEEDED | Terminal | No | Organization quota limit reached |
Status Details
PENDING
Meaning: Route has been resolved, execution record created, but transaction not yet submitted. What’s happening:- System is building the transaction
- Calculating final fees
- Preparing to submit to blockchain
RUNNING
Meaning: Transaction submitted to the blockchain, waiting for confirmation. What’s happening:- Transaction is in the mempool or being processed
- Awaiting block confirmation
- Cross-chain bridging in progress
SUCCESS
Meaning: Transaction confirmed on-chain, funds successfully bridged. This is a terminal status - the execution is complete. What to show users: “Transfer complete!” with:- Transaction hash (link to block explorer)
- Amount received on destination chain
- Completion timestamp
FAILED
Meaning: Execution failed, but may be retried automatically. Retryability depends on:- Error classification (network errors are retryable, validation errors are not)
- Whether automatic retry limit has been reached
- Error category
lastErrorCode- Specific error typelastErrorCategory- Broad categorylastErrorMessage- Human-readable descriptionretryable- Whether retry is possible
DEAD_LETTER
Meaning: Terminal failure - the execution cannot be retried. Common causes:- Maximum retry attempts exceeded
- Non-retryable error occurred
- Manual intervention required
TOKEN_BLACKLISTED
Meaning: The token is on Bridgfy’s security blacklist. Why this happens: The token has been flagged as:- Sanctioned
- A known scam
- Malicious contract
FAILED_UNROUTABLE_MAIN
Meaning: No valid cross-chain route found for the token pair. Common causes:- Token not supported by bridge providers
- Liquidity too low for the amount
- No bridges available between the chain pair
- Invalid token address
- Try a different token
- Try a different destination chain
- Reduce the amount (if liquidity issue)
- Use the simulation API before attempting deposits
FAILED_INVALID_INPUT
Meaning: Invalid parameters in the deposit or intent. Common causes:- Malformed addresses
- Invalid chain IDs
- Unsupported token
- Zero or negative amounts
FAILED_NO_FUNDS
Meaning: Insufficient balance in the deposit address. Common causes:- Deposit not yet confirmed on-chain
- Funds already spent in previous execution
- Wrong token deposited
- Deposit amount less than expected
FAILED_INSUFFICIENT_AFTER_FEES
Meaning: After deducting fees, nothing remains to bridge. Common causes:- Deposit amount too small
- Gas costs exceed deposit value
- Protocol fee + gas fee > deposit amount
- Increase deposit amount
- Use the simulation API to determine minimum amount
- Consider tokens with lower gas costs
QUOTA_EXCEEDED
Meaning: Your organization has reached its monthly quota limit. Common causes:- Free tier limits reached
- Monthly execution cap exceeded
- Volume limits hit
- Upgrade your organization’s plan in the Dashboard
- Contact sales for higher limits
Error Classification
Bridgfy classifies errors to determine if they can be retried automatically. Understanding error categories helps you build better error handling in your application.Error Categories
Retryable Errors
These errors are temporary and may succeed if retried:| Category | Description | Example |
|---|---|---|
| NETWORK | Network connectivity issues | Connection timeout, DNS failure |
| TIMEOUT | Request took too long | Provider timeout, slow RPC |
| PROVIDER_5XX | Provider server error | 500, 502, 503, 504 errors |
| RATE_LIMIT | Too many requests | 429 rate limit error |
Terminal Errors
These errors are permanent and cannot be fixed by retrying:| Category | Description | Example |
|---|---|---|
| VALIDATION | Invalid input | Bad address, invalid chain ID |
| PROVIDER_4XX | Client error | 400, 401, 403, 404 errors |
| BLOCKCHAIN_REVERT | Transaction reverted | Smart contract rejection |
| TOKEN_BLACKLISTED | Security block | Token on blacklist |
Error Classification Flow
Handling Errors in Your Application
Check Execution Status
Query execution status regularly to track progress:status- Current execution statuslastErrorCode- Error type (if failed)lastErrorMessage- Human-readable errorretryable- Whether automatic retry is possible
Display Appropriate Messages
Based on the status, show users: PENDING/RUNNING:Implement Retry Logic
ForFAILED status with retryable: true:
- Don’t create a new deposit - the system retries automatically
- Poll for status updates - Check every 10-30 seconds
- Set a timeout - If still failed after 10 minutes, show error
- Provide user updates - Show that retry is in progress
Use Simulation to Prevent Errors
Before initiating deposits, use the simulation API:FAILED_UNROUTABLE_MAIN- Verify route existsFAILED_INSUFFICIENT_AFTER_FEES- Calculate minimum amount- Unexpected fees - Show users exact amounts
Common Scenarios
Scenario: Small Deposit Amount
User deposits: 1 USDCGas cost: 0.8 USDC
Protocol fee: 0.01 USDC Result:
FAILED_INSUFFICIENT_AFTER_FEES
Solution: Use simulation API to calculate minimum deposit. Show users: “Minimum deposit: 2 USDC”
Scenario: Unsupported Token
User deposits: Custom token0x1234...Routing check: No bridges support this token Result:
FAILED_UNROUTABLE_MAIN
Solution: Before showing deposit address, verify token is routable via simulation API
Scenario: Network Issue
Error: Network timeout during executionClassification: Retryable Result:
FAILED with retryable: true
Action: System automatically retries. Status changes to RUNNING or SUCCESS on retry
Best Practices
For Integrators
- Always simulate first - Use simulation API before showing users deposit addresses
- Handle all statuses - Build UI for all possible execution statuses
- Poll for updates - Check status periodically for PENDING/RUNNING/FAILED (retryable) executions
- Show transaction hashes - Link to block explorers for transparency
- Communicate clearly - Explain errors in user-friendly language
- Set minimums - Use simulation to determine and enforce minimum deposit amounts
- Provide support links - For terminal errors, give users a way to get help
Error Recovery
For retryable errors:- Don’t create duplicate deposit intents
- Trust the automatic retry system
- Monitor execution status
- Set reasonable timeouts (10-15 minutes)
- Log error details for debugging
- Notify users with clear next steps
- For
FAILED_INSUFFICIENT_AFTER_FEES, calculate and show required minimum - For
FAILED_UNROUTABLE_MAIN, suggest alternative tokens or chains
Next Steps
- Learn about Token Support for routing capabilities
- Review Fees and Gas to understand fee calculations
- See API Reference for execution endpoints