mirror of
https://github.com/open-webui/open-webui
synced 2024-12-29 15:25:29 +00:00
Fix code scanning alert no. 150: Information exposure through an exception
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
parent
49b36937ad
commit
455b38dcc1
@ -395,9 +395,10 @@ async def generate_autocompletion(
|
|||||||
try:
|
try:
|
||||||
return await generate_chat_completion(request, form_data=payload, user=user)
|
return await generate_chat_completion(request, form_data=payload, user=user)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
log.error(f"Error generating chat completion: {e}")
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
status_code=status.HTTP_400_BAD_REQUEST,
|
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||||
content={"detail": str(e)},
|
content={"detail": "An internal error has occurred."},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user