mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Remove redundant exception for retry calls to gemini api
httpx ReadError inherits from NetworkError so not required to mention it explicitly in gemini api call retry check
This commit is contained in:
@@ -120,11 +120,7 @@ def _is_retryable_error(exception: BaseException) -> bool:
|
||||
if isinstance(exception, (gerrors.APIError, gerrors.ClientError, GeminiRetryableClientError)):
|
||||
return exception.code in [429, 502, 503, 504]
|
||||
# client errors
|
||||
if (
|
||||
isinstance(exception, httpx.TimeoutException)
|
||||
or isinstance(exception, httpx.NetworkError)
|
||||
or isinstance(exception, httpx.ReadError)
|
||||
):
|
||||
if isinstance(exception, httpx.TimeoutException) or isinstance(exception, httpx.NetworkError):
|
||||
return True
|
||||
# validation errors
|
||||
if isinstance(exception, ValueError):
|
||||
|
||||
Reference in New Issue
Block a user