Overview
The Fibrous Router API uses standard HTTP status codes and provides detailed error messages to help you understand and resolve issues. All error responses follow a consistent format.Error Response Format
All error responses follow this structure:HTTP Status Codes
The API uses standard HTTP status codes to indicate the type of error:| Status Code | Name | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 400 | Bad Request | Invalid request parameters or validation failed |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server-side error occurred |
Error Codes
400 Bad Request
Bad Request errors occur when the request parameters are invalid or validation fails.Token Same Error
Error Code:400Message:
Token in and token out cannot be the same
Description: The input token and output token addresses are identical.
Example:
tokenInAddress and tokenOutAddress are different addresses.
Integrator Fee and Surplus Percentage Conflict
Error Code:400Message:
Integrator fee and integrator surplus percentage cannot be provided together
Description: You cannot specify both integratorFeePercentageBps and integratorSurplusPercentageBps in the same request.
Example:
integratorFeePercentageBps OR integratorSurplusPercentageBps, but not both.
Validation Errors
Validation errors occur when request parameters don’t meet the required format or constraints: Common Validation Errors:| Field | Validation Rule | Error Message |
|---|---|---|
amount | Required | amount should not be null or undefined |
tokenInAddress | Required, Valid Ethereum Address | tokenInAddress must be an Ethereum address |
tokenOutAddress | Required, Valid Ethereum Address | tokenOutAddress must be an Ethereum address |
slippage | Required, 0-49 | slippage must be a number conforming to the specified constraints |
destination | Required, Valid Ethereum Address | destination must be an Ethereum address |
integratorFeePercentageBps | 0-500 | integratorFeePercentageBps must not be greater than 500 |
integratorSurplusPercentageBps | 0-5000 | integratorSurplusPercentageBps must not be greater than 5000 |
Invalid Route
Error Code:400Message:
Invalid route or custom error message
Description: The provided route is invalid, expired, or cannot be processed.
Example:
/route endpoint before generating calldata.
429 Too Many Requests
Error Code:429Message:
ThrottlerException: Too Many Requests
Description: You have exceeded the rate limit for API requests. The default rate limit is 200 requests per minute.
Example:
X-RateLimit-Limit: Maximum number of requests allowedX-RateLimit-Remaining: Number of requests remaining in the current windowX-RateLimit-Reset: Time when the rate limit resets (Unix timestamp)Retry-After: Seconds to wait before retrying
- Wait for the rate limit to reset (check
Retry-Afterheader) - Implement exponential backoff in your retry logic
- Consider requesting an API key for higher rate limits
- Contact [email protected] for enterprise rate limits
API keys provide higher rate limits. Contact us to obtain an API key for your integration.
500 Internal Server Error
Error Code:500Message:
Internal server error
Description: An unexpected error occurred on the server side. This could be due to:
- Temporary service unavailability
- Database connectivity issues
- Internal processing errors
- Retry the request after a short delay
- Check our Status Page for service status
- If the issue persists, contact support at [email protected]
Error Handling Best Practices
1. Check Status Codes
Always check the HTTP status code before processing the response:2. Handle Rate Limiting
Implement exponential backoff for rate limit errors:3. Validate Input Before Request
Validate parameters before making API calls to avoid unnecessary requests:4. Handle Validation Errors
Validation errors may return an array of error messages:5. Log Errors for Debugging
Log error details for debugging while being careful not to expose sensitive information:Common Error Scenarios
Scenario 1: Invalid Token Address
Request:Scenario 2: Same Token Addresses
Request:Scenario 3: Rate Limit Exceeded
Request: Multiple rapid requests Response:Scenario 4: Missing Required Parameters
Request:Error Codes Summary
400 Bad Request Errors
400 Bad Request Errors
- Token addresses are the same
- Invalid Ethereum address format
- Missing required parameters
- Invalid parameter values (out of range, wrong type)
- Integrator parameter conflicts
- Route amount exceeds maximum
- Invalid route provided
429 Too Many Requests
429 Too Many Requests
- Rate limit exceeded
- Too many requests in a short time period
500 Internal Server Error
500 Internal Server Error
- Server-side processing error
- Temporary service unavailability
- Database connectivity issues
Getting Help
If you encounter errors that aren’t covered in this documentation:- Check the Error Message: The error message usually provides specific information about what went wrong
- Review Request Parameters: Ensure all parameters meet the validation requirements
- Check Service Status: Visit our Status Page
- Contact Support:
- Email: [email protected]
- Discord: Join our Discord
Related Documentation
- Rate Limits - Learn about rate limiting
- V2 Migration Guide - Common issues during migration
- Route V2 - Route endpoint documentation
- Calldata V2 - Calldata endpoint documentation