From 113783ee892dd06e41721a09aca16438bd60b065 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 11 May 2026 23:05:18 +0000 Subject: [PATCH] fix: guard rate_limit_category extraction with isinstance check --- litellm/litellm_core_utils/litellm_logging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py index 7c1542a204b..c09f191c340 100644 --- a/litellm/litellm_core_utils/litellm_logging.py +++ b/litellm/litellm_core_utils/litellm_logging.py @@ -5165,7 +5165,7 @@ class StandardLoggingPayloadSetup: # reaching for the raw exception object. rate_limit_category: Optional[str] = ( getattr(original_exception, "category", None) - if original_exception is not None + if isinstance(original_exception, litellm.RateLimitError) else None )