mirror of
https://github.com/open-webui/open-webui.git
synced 2026-06-09 19:57:17 -05:00
[GH-ISSUE #18295] issue: Display custom error messages #57223
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @VRivi on GitHub (Oct 13, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/18295
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.33
Ollama Version (if applicable)
No response
Operating System
windows 11
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Hello guys,
I would like to display custom error messages in Open WebUI chat when an exception is raised in my backend (API route).
Actual Behavior
I'm using FastAPI to send OpenAI requests between my LLM and Open WebUI, but when an exception is raised, the UI seems to be loading without displaying any error message.
Steps to Reproduce
I have OpenWebUI running in a Docker container.
It's well connected with my backend because I can request my models.
When I change the route, for example with this:
@llm_router.post(
"/chat/completions",
tags=["chat"],
summary="Query to the LLM model",
status_code=status.HTTP_200_OK,
responses={
status.HTTP_401_UNAUTHORIZED: {"description": "Authentication failed"},
status.HTTP_404_NOT_FOUND: {"description": "Invalid route"},
status.HTTP_408_REQUEST_TIMEOUT: {"description": "Timeout"},
status.HTTP_500_INTERNAL_SERVER_ERROR: {"description": "Unexpected error"},
},
)
async def openai_query_streaming(query: ChatCompletionRequest, authorization: str = Security(http_auth_method)) -> StreamingResponse:
"""
Query the AWS LLM, given a user prompt
"""
raise HTTPException(status_code=404, detail="Item not found")
return
Nothing display on the UI.
Logs & Screenshots
Python log :
Open webUI :
Additional Information
Thank you for your help guys !