From 40488b3b6830ee3cbef583027ae3f16497e16307 Mon Sep 17 00:00:00 2001 From: Debanjum Date: Fri, 22 Aug 2025 19:00:35 -0700 Subject: [PATCH] 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 --- src/khoj/processor/conversation/google/utils.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/khoj/processor/conversation/google/utils.py b/src/khoj/processor/conversation/google/utils.py index b6d965e4..4f47364e 100644 --- a/src/khoj/processor/conversation/google/utils.py +++ b/src/khoj/processor/conversation/google/utils.py @@ -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):