(fix) improve unauthorized error message

This commit is contained in:
ishaan-jaff 2024-01-16 14:04:26 -08:00
parent c15adf4fe4
commit e16fa16442

View file

@ -358,7 +358,7 @@ async def user_api_key_auth(
)
return UserAPIKeyAuth(api_key=api_key, **valid_token_dict)
else:
raise Exception(f"Invalid token")
raise Exception(f"Invalid Key Passed to LiteLLM Proxy")
except Exception as e:
# verbose_proxy_logger.debug(f"An exception occurred - {traceback.format_exc()}")
traceback.print_exc()
@ -367,7 +367,7 @@ async def user_api_key_auth(
else:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=f"Invalid user key, {str(e)}",
detail=f"Authentication Error, {str(e)}",
)