mirror of
https://github.com/open-webui/open-webui
synced 2024-11-21 23:57:51 +00:00
Merge pull request #7072 from antpyykk-kone/feature/fix-pipeline-middleware-http-exception-handling
fix: handle uncaught HTTP exceptions in PipelineMiddleware
This commit is contained in:
commit
54cabc9776
@ -855,6 +855,11 @@ class PipelineMiddleware(BaseHTTPMiddleware):
|
|||||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||||
content={"detail": "Not authenticated"},
|
content={"detail": "Not authenticated"},
|
||||||
)
|
)
|
||||||
|
except HTTPException as e:
|
||||||
|
return JSONResponse(
|
||||||
|
status_code=e.status_code,
|
||||||
|
content={"detail": e.detail},
|
||||||
|
)
|
||||||
|
|
||||||
model_list = await get_all_models()
|
model_list = await get_all_models()
|
||||||
models = {model["id"]: model for model in model_list}
|
models = {model["id"]: model for model in model_list}
|
||||||
|
Loading…
Reference in New Issue
Block a user