Overview
The SDK provides typed error classes for different failure scenarios. Some errors are retryable (network issues, rate limits), while others require code changes (validation, auth).Error Types
| Error Class | Status Code | Retryable | Cause |
|---|---|---|---|
RefineValidationError | 400 | No | Invalid request parameters |
RefineAuthError | 401 | No | Invalid or missing API key |
RefineForbiddenError | 403 | No | Insufficient permissions |
RefineNotFoundError | 404 | No | Resource doesn’t exist |
RefineRateLimitError | 429 | Yes | Too many requests |
RefineTimeoutError | 408, 504 | Yes | Request timed out |
RefineServerError | 500, 502, 503 | Yes | Server-side issue |
RefineNetworkError | - | Yes | Network connectivity issue |
Basic Error Handling
Error Properties
All Refine errors extendRefineError and include:
Retry Strategies
For retryable errors, implement exponential backoff:Global Error Handler
Set a global error handler in configuration:Error Handling by Feature
Search
Recommendations
Event Tracking
Event tracking is designed to be fire-and-forget, but you can handle errors:User-Facing Error Messages
Map errors to user-friendly messages:Debugging Errors
Enable debug mode for detailed error information:Error Monitoring Integration
Integrate with error monitoring services:Handling Specific Scenarios
Rate Limiting
Network Offline
Next Steps
SDK Configuration
Configure error handling globally
Debug Plugin
Debug errors in development