From cfc55b39a9eb83b0b35417a2446cef5af8b60d05 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sat, 1 Jun 2024 17:05:33 -0700 Subject: [PATCH] fix - return in LITELLM_EXCEPTION_TYPES --- litellm/router.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/litellm/router.py b/litellm/router.py index 09b24e1d0..510d179ba 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -2295,6 +2295,10 @@ class Router: healthy_deployments=_healthy_deployments, ) time.sleep(_timeout) + + if type(original_exception) in litellm.LITELLM_EXCEPTION_TYPES: + original_exception.max_retries = num_retries + original_exception.num_retries = current_attempt raise original_exception ### HELPER FUNCTIONS