From 2d9faecc661a6479321b439eb3d45b33b94a5487 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 08:05:46 +0000 Subject: [PATCH] Revert "refactor: clean up fresh tech debt in auth 401 detection, cooldown fallback lookup and bedrock guardrail billing" This reverts commit d497e02bbf542bcf7dfaf37d5ef1054cf4ff1005. --- litellm/proxy/auth/auth_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/auth/auth_utils.py b/litellm/proxy/auth/auth_utils.py index 0b0b1b1fa8c..aa6ddae438d 100644 --- a/litellm/proxy/auth/auth_utils.py +++ b/litellm/proxy/auth/auth_utils.py @@ -53,7 +53,8 @@ def is_unauthorized_error(exception: BaseException | None) -> bool: if not isinstance(exception, (HTTPException, ProxyException)): return False - status_code: Final[object] = exception.code if isinstance(exception, ProxyException) else exception.status_code + code: Final[object] = getattr(exception, "code", None) + status_code: Final[object] = code if code is not None else getattr(exception, "status_code", None) return str(status_code) == str(status.HTTP_401_UNAUTHORIZED)