From 71ed3799c2505931cb59ea10bcd9323f13ff0890 Mon Sep 17 00:00:00 2001 From: ErnestHysa Date: Sun, 31 May 2026 00:37:43 +0100 Subject: [PATCH] fix: handle InternalServerError in allowed fails policy --- litellm/router.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/litellm/router.py b/litellm/router.py index d60c39ca402..6df51d13a4c 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -11744,6 +11744,11 @@ class Router: and allowed_fails_policy.BadRequestErrorAllowedFails is not None ): return allowed_fails_policy.BadRequestErrorAllowedFails + if ( + isinstance(exception, litellm.InternalServerError) + and allowed_fails_policy.InternalServerErrorAllowedFails is not None + ): + return allowed_fails_policy.InternalServerErrorAllowedFails def _initialize_alerting(self): from litellm.integrations.SlackAlerting.slack_alerting import SlackAlerting