diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 18981940ad..af281fff8c 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -1893,6 +1893,8 @@ async def chat_completion( pass finally: raise # re-raise to ensure proper task cancellation handling + except HTTPException: + raise except Exception as e: log.debug(f"Error processing chat payload: {e}") if metadata.get("chat_id") and metadata.get("message_id"): diff --git a/backend/open_webui/routers/pipelines.py b/backend/open_webui/routers/pipelines.py index 24cf6682c7..90c03ac12e 100644 --- a/backend/open_webui/routers/pipelines.py +++ b/backend/open_webui/routers/pipelines.py @@ -101,7 +101,7 @@ async def process_pipeline_inlet_filter(request, payload, user, models): else {} ) if "detail" in res: - raise Exception(response.status, res["detail"]) + raise HTTPException(status_code=e.status, detail=res["detail"]) except Exception as e: log.exception(f"Connection error: {e}")