API Errors
Understanding and handling API errors correctly ensures your integration is robust and user-friendly.Error Response Format
All errors follow a consistent structure:Error Codes
INVALID_INPUT
The request body or parameters are invalid. HTTP Status:400
Causes:
- Missing required fields
- Invalid data types
- Malformed JSON
RATE_LIMIT_EXCEEDED
Request exceeds rate limit for the endpoint. HTTP Status:429
Causes:
- Too many requests in the rate limit window
- Multiple clients sharing the same IP
X-RateLimit-Reset time or Retry-After seconds have passed.
See Rate Limits for handling strategies.
INTERNAL_ERROR
An unexpected server error occurred. HTTP Status:500
Causes:
- Temporary server issues
- Database connection problems
- Unexpected data conditions
NOT_FOUND
Requested resource does not exist. HTTP Status:404
Causes:
- Invalid endpoint path
- Removed compatibility data
NO_TECH_DETECTED
Scan request found no recognizable technologies. HTTP Status:400
Causes:
- No packages in dependencies
- Unrecognized package names
- Empty package.json
HTTP Status Codes
| Status | Meaning | Action |
|---|---|---|
200 | Success | Process the response |
400 | Bad Request | Fix request parameters |
404 | Not Found | Verify endpoint URL |
429 | Rate Limited | Wait and retry |
500 | Server Error | Retry with backoff |
Error Handling Best Practices
1. Always Check HTTP Status
2. Implement Retry Logic
3. Log Errors Contextually
4. Provide User-Friendly Messages
Testing Error Handling
Test Scenarios
| Scenario | How to Test | Expected Behavior |
|---|---|---|
| Invalid input | Send empty techA/techB | Returns 400 with INVALID_INPUT |
| Rate limit | Make 60+ requests in a minute | Returns 429 with RATE_LIMIT_EXCEEDED |
| Unknown tech | Use non-existent technology names | Returns 200 with status=“unknown” |
| Server error | (Contact support to simulate) | Returns 500 with INTERNAL_ERROR |
Example Test
Getting Help
Persistent Errors
If you encounter errors consistently:- Check Status Page - Verify service is operational
- Review Your Code - Ensure proper error handling
- Check Rate Limits - Verify you’re within limits
- Contact Support - Include error code and request details
Support Contact
- Email: [email protected]
- GitHub: github.com/devradar-dev/website/issues
- Include in report:
- Error code
- Request details (sanitize sensitive data)
- Timestamp
- Your account ID (if applicable)
What’s Next
- Rate Limits - Understanding rate limiting
- Check Endpoint - Endpoint reference
- API Overview - API introduction
Need help? Contact Support →