fix(backend): catch 404 http exceptions before generalized exception block in files router (#21687)
This commit is contained in:
1 file changed
+4
@@ -690,6 +690,8 @@ async def get_file_content_by_id(
|
|||||||
status_code=status.HTTP_404_NOT_FOUND,
|
status_code=status.HTTP_404_NOT_FOUND,
|
||||||
detail=ERROR_MESSAGES.NOT_FOUND,
|
detail=ERROR_MESSAGES.NOT_FOUND,
|
||||||
)
|
)
|
||||||
|
except HTTPException as e:
|
||||||
|
raise e
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.exception(e)
|
log.exception(e)
|
||||||
log.error("Error getting file content")
|
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,
|
status_code=status.HTTP_404_NOT_FOUND,
|
||||||
detail=ERROR_MESSAGES.NOT_FOUND,
|
detail=ERROR_MESSAGES.NOT_FOUND,
|
||||||
)
|
)
|
||||||
|
except HTTPException as e:
|
||||||
|
raise e
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.exception(e)
|
log.exception(e)
|
||||||
log.error("Error getting file content")
|
log.error("Error getting file content")
|
||||||
|
|||||||
Reference in new issue
Block a user