From 4c134b1ec7bb5fac86d1bd4e0480b8c39b9fe52d Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Mon, 26 Feb 2024 22:44:05 -0800 Subject: [PATCH] fix(proxy/utils.py): fix try-except for creating a view --- litellm/proxy/utils.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index 6b945ce72..f814d6098 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -504,9 +504,8 @@ class PrismaClient: except Exception as e: # If an error occurs, the view does not exist, so create it value = await self.health_check() - if '"litellm_verificationtokenview" does not exist' in str(e): - await self.db.execute_raw( - """ + await self.db.execute_raw( + """ CREATE VIEW "LiteLLM_VerificationTokenView" AS SELECT v.*, @@ -517,9 +516,7 @@ class PrismaClient: FROM "LiteLLM_VerificationToken" v LEFT JOIN "LiteLLM_TeamTable" t ON v.team_id = t.team_id; """ - ) - else: - raise e + ) return "LiteLLM_VerificationTokenView Created!"