forked from phoenix/litellm-mirror
fix(proxy/utils.py): add more logging for prisma client get_data error
This commit is contained in:
parent
7ae7e95da1
commit
4b60bea975
1 changed files with 8 additions and 1 deletions
|
@ -761,6 +761,7 @@ class PrismaClient:
|
||||||
int
|
int
|
||||||
] = None, # pagination, number of rows to getch when find_all==True
|
] = None, # pagination, number of rows to getch when find_all==True
|
||||||
):
|
):
|
||||||
|
args_passed_in = locals()
|
||||||
verbose_proxy_logger.debug(
|
verbose_proxy_logger.debug(
|
||||||
f"PrismaClient: get_data: token={token}, table_name: {table_name}, query_type: {query_type}, user_id: {user_id}, user_id_list: {user_id_list}, team_id: {team_id}, team_id_list: {team_id_list}, key_val: {key_val}"
|
f"PrismaClient: get_data: token={token}, table_name: {table_name}, query_type: {query_type}, user_id: {user_id}, user_id_list: {user_id_list}, team_id: {team_id}, team_id_list: {team_id_list}, key_val: {key_val}"
|
||||||
)
|
)
|
||||||
|
@ -794,6 +795,12 @@ class PrismaClient:
|
||||||
response.expires, datetime
|
response.expires, datetime
|
||||||
):
|
):
|
||||||
response.expires = response.expires.isoformat()
|
response.expires = response.expires.isoformat()
|
||||||
|
else:
|
||||||
|
# Token does not exist.
|
||||||
|
raise HTTPException(
|
||||||
|
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||||
|
detail=f"Authentication Error: invalid user key - user key does not exist in db. User Key={token}",
|
||||||
|
)
|
||||||
elif query_type == "find_all" and user_id is not None:
|
elif query_type == "find_all" and user_id is not None:
|
||||||
response = await self.db.litellm_verificationtoken.find_many(
|
response = await self.db.litellm_verificationtoken.find_many(
|
||||||
where={"user_id": user_id},
|
where={"user_id": user_id},
|
||||||
|
@ -997,7 +1004,7 @@ class PrismaClient:
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
prisma_query_info = f"LiteLLM Prisma Client Exception: get_data: token={token}, table_name: {table_name}, query_type: {query_type}, user_id: {user_id}, user_id_list: {user_id_list}, team_id: {team_id}, team_id_list: {team_id_list}, key_val: {key_val}"
|
prisma_query_info = f"LiteLLM Prisma Client Exception: Error with `get_data`. Args passed in: {args_passed_in}"
|
||||||
error_msg = prisma_query_info + str(e)
|
error_msg = prisma_query_info + str(e)
|
||||||
print_verbose(error_msg)
|
print_verbose(error_msg)
|
||||||
error_traceback = error_msg + "\n" + traceback.format_exc()
|
error_traceback = error_msg + "\n" + traceback.format_exc()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue