feat(devgen/providers): improve error detection for rate‑limiting and quota exceeded responses

Enhancements:
- Extend error message parsing to capture additional throttling indicators such as "RESOURCE_EXHAUSTED", "QUOTA_EXCEEDED", and "THROTTLED".
- Refactor the conditional logic for better readability and maintainability.
- Keep existing retry behavior while increasing resilience to API rate‑limit errors.
This commit is contained in:
sankalp committed 2026-03-06 19:43:16 +05:45
1 parent 9554f7af2a
commit 1b36c3f2d7
1 file changed
+9 -1
+9 -1
View File
@@ -38,7 +38,15 @@ class GeminiProvider:
except Exception as e:
error_msg = str(e).upper()
# Check for 429 or ResourceExhausted in common error formats
if any(x in error_msg for x in ["429", "RESOURCE_EXHAUSTED", "QUOTA_EXCEEDED", "THROTTLED"]):
if any(
x in error_msg
for x in [
"429",
"RESOURCE_EXHAUSTED",
"QUOTA_EXCEEDED",
"THROTTLED",
]
):
if attempt < max_retries:
delay = base_delay * (2**attempt)
print(