raise budget_exceeded in user_api_key_auth

This commit is contained in:
Ishaan Jaff 2024-07-08 12:45:39 -07:00
parent c6256284da
commit 25ddbbb41d
4 changed files with 59 additions and 56 deletions

View file

@ -422,7 +422,7 @@ async def user_info(
if isinstance(e, HTTPException):
raise ProxyException(
message=getattr(e, "detail", f"Authentication Error({str(e)})"),
type="auth_error",
type=ProxyErrorTypes.auth_error,
param=getattr(e, "param", "None"),
code=getattr(e, "status_code", status.HTTP_400_BAD_REQUEST),
)
@ -430,7 +430,7 @@ async def user_info(
raise e
raise ProxyException(
message="Authentication Error, " + str(e),
type="auth_error",
type=ProxyErrorTypes.auth_error,
param=getattr(e, "param", "None"),
code=status.HTTP_400_BAD_REQUEST,
)
@ -523,7 +523,7 @@ async def user_update(data: UpdateUserRequest):
if isinstance(e, HTTPException):
raise ProxyException(
message=getattr(e, "detail", f"Authentication Error({str(e)})"),
type="auth_error",
type=ProxyErrorTypes.auth_error,
param=getattr(e, "param", "None"),
code=getattr(e, "status_code", status.HTTP_400_BAD_REQUEST),
)
@ -531,7 +531,7 @@ async def user_update(data: UpdateUserRequest):
raise e
raise ProxyException(
message="Authentication Error, " + str(e),
type="auth_error",
type=ProxyErrorTypes.auth_error,
param=getattr(e, "param", "None"),
code=status.HTTP_400_BAD_REQUEST,
)
@ -582,7 +582,7 @@ async def user_request_model(request: Request):
if isinstance(e, HTTPException):
raise ProxyException(
message=getattr(e, "detail", f"Authentication Error({str(e)})"),
type="auth_error",
type=ProxyErrorTypes.auth_error,
param=getattr(e, "param", "None"),
code=getattr(e, "status_code", status.HTTP_400_BAD_REQUEST),
)
@ -590,7 +590,7 @@ async def user_request_model(request: Request):
raise e
raise ProxyException(
message="Authentication Error, " + str(e),
type="auth_error",
type=ProxyErrorTypes.auth_error,
param=getattr(e, "param", "None"),
code=status.HTTP_400_BAD_REQUEST,
)
@ -630,7 +630,7 @@ async def user_get_requests():
if isinstance(e, HTTPException):
raise ProxyException(
message=getattr(e, "detail", f"Authentication Error({str(e)})"),
type="auth_error",
type=ProxyErrorTypes.auth_error,
param=getattr(e, "param", "None"),
code=getattr(e, "status_code", status.HTTP_400_BAD_REQUEST),
)
@ -638,7 +638,7 @@ async def user_get_requests():
raise e
raise ProxyException(
message="Authentication Error, " + str(e),
type="auth_error",
type=ProxyErrorTypes.auth_error,
param=getattr(e, "param", "None"),
code=status.HTTP_400_BAD_REQUEST,
)