|
| 1 | +--- |
| 2 | +title: "Error Codes" |
| 3 | +description: >- |
| 4 | + Reference guide for Express Relay error codes and troubleshooting common issues. |
| 5 | +--- |
| 6 | + |
| 7 | +# Error Codes |
| 8 | + |
| 9 | +This page provides a reference for common error codes you may encounter when integrating with Express Relay, along with explanations and suggested solutions. |
| 10 | + |
| 11 | +## HTTP API Errors |
| 12 | + |
| 13 | +### 400 Bad Request |
| 14 | + |
| 15 | +**Invalid chain_id** |
| 16 | + |
| 17 | +- **Error:** Chain ID is not supported |
| 18 | +- **Solution:** Ensure you're using a supported chain ID (e.g., "solana", "development-solana") |
| 19 | + |
| 20 | +**Invalid transaction format** |
| 21 | + |
| 22 | +- **Error:** Transaction data is not properly encoded |
| 23 | +- **Solution:** Ensure transaction is base64 encoded and properly formatted |
| 24 | + |
| 25 | +**Missing required fields** |
| 26 | + |
| 27 | +- **Error:** Required fields are missing from the request |
| 28 | +- **Solution:** Check that all required parameters are included in your request |
| 29 | + |
| 30 | +### 401 Unauthorized |
| 31 | + |
| 32 | +**Invalid authentication** |
| 33 | + |
| 34 | +- **Error:** Authentication credentials are invalid or missing |
| 35 | +- **Solution:** Verify your API credentials and authentication headers |
| 36 | + |
| 37 | +### 404 Not Found |
| 38 | + |
| 39 | +**Opportunity not found** |
| 40 | + |
| 41 | +- **Error:** The requested opportunity does not exist |
| 42 | +- **Solution:** Check that the opportunity ID is correct and the opportunity hasn't expired |
| 43 | + |
| 44 | +### 429 Too Many Requests |
| 45 | + |
| 46 | +**Rate limit exceeded** |
| 47 | + |
| 48 | +- **Error:** Too many requests sent in a short time period |
| 49 | +- **Solution:** Implement exponential backoff and respect rate limits |
| 50 | + |
| 51 | +### 500 Internal Server Error |
| 52 | + |
| 53 | +**Server error** |
| 54 | + |
| 55 | +- **Error:** Internal server error occurred |
| 56 | +- **Solution:** Retry the request after a brief delay. If the issue persists, contact support |
| 57 | + |
| 58 | +## WebSocket Errors |
| 59 | + |
| 60 | +### Connection Errors |
| 61 | + |
| 62 | +**Connection failed** |
| 63 | + |
| 64 | +- **Error:** Unable to establish WebSocket connection |
| 65 | +- **Solution:** Check network connectivity and WebSocket endpoint URL |
| 66 | + |
| 67 | +**Authentication failed** |
| 68 | + |
| 69 | +- **Error:** WebSocket authentication failed |
| 70 | +- **Solution:** Verify authentication credentials for WebSocket connection |
| 71 | + |
| 72 | +### Subscription Errors |
| 73 | + |
| 74 | +**Invalid subscription** |
| 75 | + |
| 76 | +- **Error:** Subscription parameters are invalid |
| 77 | +- **Solution:** Check that chain_ids array contains valid chain identifiers |
| 78 | + |
| 79 | +**Subscription limit exceeded** |
| 80 | + |
| 81 | +- **Error:** Too many active subscriptions |
| 82 | +- **Solution:** Unsubscribe from unused chains before subscribing to new ones |
| 83 | + |
| 84 | +## Transaction Errors |
| 85 | + |
| 86 | +### Bid Submission Errors |
| 87 | + |
| 88 | +**Insufficient balance** |
| 89 | + |
| 90 | +- **Error:** Insufficient funds to cover bid amount |
| 91 | +- **Solution:** Ensure wallet has sufficient balance for the bid amount plus transaction fees |
| 92 | + |
| 93 | +**Invalid bid amount** |
| 94 | + |
| 95 | +- **Error:** Bid amount is below minimum or above maximum |
| 96 | +- **Solution:** Check bid amount constraints for the specific opportunity |
| 97 | + |
| 98 | +**Permission denied** |
| 99 | + |
| 100 | +- **Error:** Not authorized to submit bid for this opportunity |
| 101 | +- **Solution:** Verify permission key and ensure proper authorization |
| 102 | + |
| 103 | +### On-Chain Execution Errors |
| 104 | + |
| 105 | +**Transaction failed** |
| 106 | + |
| 107 | +- **Error:** Transaction execution failed on-chain |
| 108 | +- **Solution:** Check transaction logs for specific failure reasons |
| 109 | + |
| 110 | +**Transaction expired** |
| 111 | + |
| 112 | +- **Error:** Transaction expired before execution |
| 113 | +- **Solution:** Submit bids with sufficient time before deadline |
| 114 | + |
| 115 | +**Insufficient gas/compute** |
| 116 | + |
| 117 | +- **Error:** Transaction ran out of gas or compute units |
| 118 | +- **Solution:** Increase gas limit or compute unit allocation |
| 119 | + |
| 120 | +## SDK-Specific Errors |
| 121 | + |
| 122 | +### JavaScript SDK Errors |
| 123 | + |
| 124 | +**Network timeout** |
| 125 | + |
| 126 | +- **Error:** Request timed out |
| 127 | +- **Solution:** Increase timeout configuration or check network connectivity |
| 128 | + |
| 129 | +**Invalid configuration** |
| 130 | + |
| 131 | +- **Error:** SDK configuration is invalid |
| 132 | +- **Solution:** Verify baseUrl and other configuration parameters |
| 133 | + |
| 134 | +### Python SDK Errors |
| 135 | + |
| 136 | +**Connection error** |
| 137 | + |
| 138 | +- **Error:** Failed to connect to Express Relay server |
| 139 | +- **Solution:** Check network connectivity and server endpoint |
| 140 | + |
| 141 | +**Serialization error** |
| 142 | + |
| 143 | +- **Error:** Failed to serialize/deserialize data |
| 144 | +- **Solution:** Ensure data types match expected format |
| 145 | + |
| 146 | +## Troubleshooting Tips |
| 147 | + |
| 148 | +### General Guidelines |
| 149 | + |
| 150 | +1. **Check network connectivity** - Ensure your application can reach Express Relay endpoints |
| 151 | +2. **Verify parameters** - Double-check all request parameters for correct format and values |
| 152 | +3. **Monitor rate limits** - Implement proper rate limiting to avoid 429 errors |
| 153 | +4. **Handle timeouts** - Implement retry logic with exponential backoff |
| 154 | +5. **Check logs** - Review both client and server logs for detailed error information |
| 155 | + |
| 156 | +### Getting Help |
| 157 | + |
| 158 | +If you encounter persistent issues: |
| 159 | + |
| 160 | +1. Check the [API documentation](https://per-mainnet.dourolabs.app/docs) for detailed endpoint specifications |
| 161 | +2. Review example implementations in the SDK repositories |
| 162 | +3. Join the community Discord for support and discussion |
| 163 | +4. Contact technical support with detailed error information and reproduction steps |
| 164 | + |
| 165 | +### Common Patterns |
| 166 | + |
| 167 | +**Retry Logic Example** |
| 168 | + |
| 169 | +```typescript |
| 170 | +const maxRetries = 3; |
| 171 | +let retryCount = 0; |
| 172 | + |
| 173 | +while (retryCount < maxRetries) { |
| 174 | + try { |
| 175 | + const result = await client.submitBid(bid); |
| 176 | + return result; |
| 177 | + } catch (error) { |
| 178 | + retryCount++; |
| 179 | + if (retryCount === maxRetries) { |
| 180 | + throw error; |
| 181 | + } |
| 182 | + await new Promise((resolve) => setTimeout(resolve, 1000 * retryCount)); |
| 183 | + } |
| 184 | +} |
| 185 | +``` |
| 186 | + |
| 187 | +**Error Handling Example** |
| 188 | + |
| 189 | +```typescript |
| 190 | +try { |
| 191 | + const opportunities = await client.getOpportunities(); |
| 192 | +} catch (error) { |
| 193 | + if (error.status === 429) { |
| 194 | + // Rate limited - wait and retry |
| 195 | + await new Promise((resolve) => setTimeout(resolve, 5000)); |
| 196 | + } else if (error.status === 500) { |
| 197 | + // Server error - log and alert |
| 198 | + console.error("Server error:", error); |
| 199 | + } else { |
| 200 | + // Other errors - handle appropriately |
| 201 | + console.error("Request failed:", error); |
| 202 | + } |
| 203 | +} |
| 204 | +``` |
0 commit comments