mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-28 04:04:31 +00:00
(fix) improve unauthorized error message
This commit is contained in:
parent
8f047df13f
commit
e1c4d3f41d
1 changed files with 2 additions and 2 deletions
|
@ -358,7 +358,7 @@ async def user_api_key_auth(
|
||||||
)
|
)
|
||||||
return UserAPIKeyAuth(api_key=api_key, **valid_token_dict)
|
return UserAPIKeyAuth(api_key=api_key, **valid_token_dict)
|
||||||
else:
|
else:
|
||||||
raise Exception(f"Invalid token")
|
raise Exception(f"Invalid Key Passed to LiteLLM Proxy")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# verbose_proxy_logger.debug(f"An exception occurred - {traceback.format_exc()}")
|
# verbose_proxy_logger.debug(f"An exception occurred - {traceback.format_exc()}")
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
@ -367,7 +367,7 @@ async def user_api_key_auth(
|
||||||
else:
|
else:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||||
detail=f"Invalid user key, {str(e)}",
|
detail=f"Authentication Error, {str(e)}",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue