From 8c713a171d6ca97eeec09675c89adeef56946d3e Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Sat, 21 Feb 2026 15:48:51 -0500 Subject: [PATCH] fix(backend): catch 404 http exceptions before generalized exception block in files router (#21687) --- backend/open_webui/routers/files.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/open_webui/routers/files.py b/backend/open_webui/routers/files.py index ad667533dd..b9c9c73e8e 100644 --- a/backend/open_webui/routers/files.py +++ b/backend/open_webui/routers/files.py @@ -690,6 +690,8 @@ async def get_file_content_by_id( status_code=status.HTTP_404_NOT_FOUND, detail=ERROR_MESSAGES.NOT_FOUND, ) + except HTTPException as e: + raise e except Exception as e: log.exception(e) log.error("Error getting file content") @@ -741,6 +743,8 @@ async def get_html_file_content_by_id( status_code=status.HTTP_404_NOT_FOUND, detail=ERROR_MESSAGES.NOT_FOUND, ) + except HTTPException as e: + raise e except Exception as e: log.exception(e) log.error("Error getting file content")