Learn how to handle errors and edge cases in the Duro API.
The API returns different types of errors:
Validation errors
Authentication errors
Authorization errors
Rate limiting errors
Server errors
Implement proper error handling
Add retry logic for rate limits
Log errors for debugging
Handle network timeouts
Join our for support and discussions.
{
"errors": [
{
"message": "Not authorized to access Component",
"path": ["component"],
"extensions": {
"code": "FORBIDDEN",
"classification": "AuthorizationError"
}
}
]
}# Rate Limiting Error
{
"errors": [
{
"message": "Rate limit exceeded",
"extensions": {
"code": "RATE_LIMITED",
"retryAfter": 60
}
}
]
}async function queryWithRetry(query: string, maxRetries = 3) {
for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
return await executeQuery(query);
} catch (error) {
if (!isRetryableError(error) || attempt === maxRetries) {
throw error;
}
await delay(exponentialBackoff(attempt));
}
}
}