Error Handling
Overview
DEXCHANGE-API uses conventional HTTP response codes to indicate the success or failure of API requests. In general:- Codes in the
2xxrange indicate success - Codes in the
4xxrange indicate an error that failed given the information provided (e.g., a required parameter was omitted) - Codes in the
5xxrange indicate an error with our servers
Error Response Format
All error responses follow this format:HTTP Status Codes
Common Error Codes
Authentication Errors
Transaction Errors
Validation Errors
Service Errors
Best Practices
-
Always check the response status
- Verify both HTTP status code and response body
-
Implement proper error handling
- Handle both expected and unexpected errors
- Log errors for debugging
-
Retry mechanism
- Implement exponential backoff for 5xx errors
- Don’t retry on 4xx errors (except 429)
-
Rate limiting
- Monitor rate limit headers
- Implement rate limit handling
Example Error Handling
Support
If you encounter any errors that you can’t resolve, please contact our support team:- Email: team@dexchange.sn
- Status page: status.dexchange.sn