test: fix raise

This commit is contained in:
Krrish Dholakia 2025-10-04 16:11:22 -07:00
parent 8dc53c0438
commit 63cb2764fe
3 changed files with 6 additions and 3 deletions

View file

@ -923,8 +923,7 @@ async def generate_key_fn(
litellm_changed_by=litellm_changed_by,
team_table=team_table,
)
except HTTPException as e:
raise e
except Exception as e:
verbose_proxy_logger.exception(
"litellm.proxy.proxy_server.generate_key_fn(): Exception occured - {}".format(

View file

@ -1511,7 +1511,10 @@ def test_key_generate_with_custom_auth(prisma_client):
asyncio.run(test())
except Exception as e:
print("Got Exception", e)
print(e.message)
if hasattr(e, "message"):
print(e.message)
else:
print(e)
pytest.fail(f"An exception occurred - {str(e)}")

View file

@ -18,6 +18,7 @@ from litellm.proxy._types import (
LiteLLM_TeamTableCachedObj,
LiteLLM_VerificationToken,
LitellmUserRoles,
ProxyException,
UpdateKeyRequest,
)
from litellm.proxy.auth.user_api_key_auth import UserAPIKeyAuth