From c09ca785a4c519c1172b94e8b102cb324d67d194 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 26 Nov 2024 23:42:29 -0800 Subject: [PATCH] handle async_log_proxy_authentication_errors --- litellm/proxy/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index 933db8a76b1..1fe944a7288 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -891,7 +891,7 @@ class ProxyLogging: original_exception: Exception, request: Request, parent_otel_span: Optional[Any], - api_key: str, + api_key: Optional[str], ): """ Handler for Logging Authentication Errors on LiteLLM Proxy @@ -905,7 +905,7 @@ class ProxyLogging: user_api_key_dict = UserAPIKeyAuth( parent_otel_span=parent_otel_span, - token=_hash_token_if_needed(token=api_key), + token=_hash_token_if_needed(token=api_key or ""), ) try: request_data = await request.json()