feat - add num retries and max retries in exception

This commit is contained in:
Ishaan Jaff 2024-06-01 16:53:00 -07:00
parent 0c97694833
commit 2341d99bdc
3 changed files with 24 additions and 5 deletions

View file

@ -2041,11 +2041,10 @@ class Router:
)
await asyncio.sleep(_timeout)
try:
cooldown_deployments = await self._async_get_cooldown_deployments()
original_exception.message += f"\nNumber Retries = {current_attempt + 1}, Max Retries={num_retries}\nCooldown Deployments={cooldown_deployments}"
except:
pass
if type(original_exception) in litellm.LITELLM_EXCEPTION_TYPES:
original_exception.max_retries = num_retries
original_exception.num_retries = current_attempt
raise original_exception
def should_retry_this_error(