From c7e3e50851766896af6c255004ef2efb6d28fca6 Mon Sep 17 00:00:00 2001 From: wangjifeng Date: Fri, 24 Apr 2026 20:41:57 +0800 Subject: [PATCH] fix: use int() cast when comparing ProxyException.code (code is str not int) --- litellm/proxy/auth/auth_exception_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/auth/auth_exception_handler.py b/litellm/proxy/auth/auth_exception_handler.py index 5bb67c22d11..4285b7886f0 100644 --- a/litellm/proxy/auth/auth_exception_handler.py +++ b/litellm/proxy/auth/auth_exception_handler.py @@ -80,7 +80,7 @@ class UserAPIKeyAuthExceptionHandler: # flooding error logs with routine access-control events. # All other exceptions are unexpected and logged at ERROR with traceback. _is_expected_auth_failure = ( - isinstance(e, ProxyException) and e.code in (401, 403) + isinstance(e, ProxyException) and int(e.code) in (401, 403) ) or ( isinstance(e, HTTPException) and e.status_code in (401, 403) )