From 1e769bcb7715f8a6d3f9173f949a6a1ccf87fa8d Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 23 Feb 2024 14:44:33 -0800 Subject: [PATCH] fix(proxy/utils.py): raise exception if get data for tokens is called on None token --- litellm/proxy/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index 4e08f8fb9f..9f9774412f 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -554,6 +554,11 @@ class PrismaClient: f"PrismaClient: find_unique for token: {hashed_token}" ) if query_type == "find_unique": + if token is None: + raise HTTPException( + status_code=400, + detail={"error": f"No token passed in. Token={token}"}, + ) response = await self.db.litellm_verificationtoken.find_unique( where={"token": hashed_token} )