Error Handling
Last updated
Was this helpful?
Was this helpful?
# 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));
}
}
}