Error Response Format
All API errors follow a consistent JSON structure:Always
false for error responsesHuman-readable error message in Spanish
Optional error code for programmatic handling
HTTP Status Codes
The Viax API uses standard HTTP status codes:Success Codes
Request succeeded. Response includes requested data.
Resource successfully created (not commonly used)
Client Error Codes
Invalid request parameters or malformed JSONCommon causes:
- Missing required fields
- Invalid data types
- Malformed JSON
Authentication failed or missing credentialsCommon causes:
- Invalid email/password combination
- User account does not exist
User lacks permission for the requested actionCommon causes:
- Account is inactive or suspended
- Insufficient permissions for admin endpoints
- Driver not approved
Requested resource does not existCommon causes:
- User ID not found
- Trip ID not found
- Endpoint URL is incorrect
Server Error Codes
Unexpected server errorAction: Retry the request. If the error persists, contact support.
Service temporarily unavailableAction: Wait and retry with exponential backoff.
Exception Types
The Viax client SDK defines the following exception types:ServerException
Thrown when the server returns an error response (HTTP 400, 500, etc.).NetworkException
Thrown when there’s a network connectivity issue.- No internet connection
- Request timeout
- DNS resolution failure
- Connection refused
NotFoundException
Thrown when a resource is not found (HTTP 404).AuthException
Thrown for authentication failures (HTTP 401).UnauthorizedException
Thrown for authorization failures (HTTP 403).ValidationException
Thrown for data validation errors.Common Error Scenarios
Invalid Credentials
Email Already Registered
Missing Required Fields
Trip Not Found
Driver Not Available
Network Timeout
Error Handling Best Practices
Retry Strategy
For transient errors (network issues, 503 errors), implement exponential backoff:Timeout Configuration
The API has a default timeout of 30 seconds:Error Monitoring
The API includes error logging and crash reporting. Enable analytics in your configuration:
Support
If you encounter persistent errors or unexpected behavior:- Check API status if monitoring is available
- Review the documentation for the specific endpoint
- Verify your request format matches the examples
- Contact technical support with:
- Timestamp of the error
- Request details (without sensitive data)
- Full error response
- Steps to reproduce