Overview
This guide covers how to handle errors and edge cases when using the Gather API. Proper error handling ensures your integration is robust and provides a good user experience.Error Response Format
All errors follow a consistent format:HTTP Status Codes
400 Bad Request
Invalid request parameters or malformed request body.401 Unauthorized
Invalid or missing authentication credentials.404 Not Found
Resource not found.429 Too Many Requests
Rate limit exceeded.500 Internal Server Error
Server error.Error Handling Patterns
Retry Logic
Implement retry logic for transient errors (429, 500):- JavaScript
- Python
Validation Error Handling
Handle validation errors gracefully:Common Error Scenarios
Invalid Credentials
Symptom: 401 Unauthorized Solution:- Verify credentials are correct
- Check that your API key is correctly formatted and prefixed with
qapi_ - Ensure using
organizationId:apiKey(not reversed)
Resource Not Found
Symptom: 404 Not Found Solution:- Verify resource ID exists
- Check you have access to the resource
- Ensure using correct endpoint path
Rate Limit Exceeded
Symptom: 429 Too Many Requests Solution:- Implement exponential backoff
- Monitor rate limit headers
- Cache responses when possible
- Reduce request frequency
Network Errors
Symptom: Connection timeout or network errors Solution:- Implement retry logic
- Use connection pooling
- Set appropriate timeouts
- Handle network failures gracefully
Best Practices
- Always Check Status Codes: Don’t assume requests succeed
- Log Errors: Log errors with request IDs for debugging
- User-Friendly Messages: Translate technical errors to user-friendly messages
- Retry Strategically: Retry transient errors, not client errors
- Handle Edge Cases: Plan for network failures, timeouts, and partial failures
- Monitor Error Rates: Track error rates and types to identify issues

