fix(backend): catch 404 http exceptions before generalized exception block in files router (#21687)

This commit is contained in:
G30
2026-02-21 14:48:51 -06:00
committed by GitHub
parent 7e42d727e8
commit 8c713a171d
+4
View File
@@ -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")