Kaynağa Gözat

fix: handle http exceptions

Antti Pyykkönen 5 ay önce
ebeveyn
işleme
4f6ae8239d
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  1. 5 0
      backend/open_webui/main.py

+ 5 - 0
backend/open_webui/main.py

@@ -855,6 +855,11 @@ class PipelineMiddleware(BaseHTTPMiddleware):
                     status_code=status.HTTP_401_UNAUTHORIZED,
                     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()
         models = {model["id"]: model for model in model_list}