mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
is_database_connection_error
This commit is contained in:
parent
4948673e35
commit
f8caebc54b
3 changed files with 17 additions and 6 deletions
|
@ -675,7 +675,12 @@ async def _user_api_key_auth_builder( # noqa: PLR0915
|
|||
if (
|
||||
prisma_client is None
|
||||
): # if both master key + user key submitted, and user key != master key, and no db connected, raise an error
|
||||
raise Exception("No connected db.")
|
||||
raise ProxyException(
|
||||
message="No connected db.",
|
||||
type=ProxyErrorTypes.no_db_connection,
|
||||
code=400,
|
||||
param=None,
|
||||
)
|
||||
|
||||
## check for cache hit (In-Memory Cache)
|
||||
_user_role = None
|
||||
|
@ -1001,8 +1006,6 @@ async def _user_api_key_auth_builder( # noqa: PLR0915
|
|||
route=route,
|
||||
start_time=start_time,
|
||||
)
|
||||
else:
|
||||
raise Exception()
|
||||
except Exception as e:
|
||||
return await UserAPIKeyAuthExceptionHandler._handle_authentication_error(
|
||||
e=e,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue