From 638b59fbcdeacf34792d1b0a9015acc6bdfacbfe Mon Sep 17 00:00:00 2001 From: Wang Qi Date: Fri, 26 Jun 2026 18:46:21 +0800 Subject: [PATCH] Fix handle move file failed (#16384) Follow on PR: #16350 --- api/apps/services/file_api_service.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/apps/services/file_api_service.py b/api/apps/services/file_api_service.py index cfde3de294..ef9ebd47c9 100644 --- a/api/apps/services/file_api_service.py +++ b/api/apps/services/file_api_service.py @@ -568,12 +568,14 @@ async def move_files(uid: str, src_file_ids: list, dest_file_id: str = None, new while settings.STORAGE_IMPL.obj_exist(dest_folder_entry.id, new_location): new_location += "_" try: - settings.STORAGE_IMPL.move( + moved = settings.STORAGE_IMPL.move( source_file_entry.parent_id, source_file_entry.location, dest_folder_entry.id, new_location, ) except Exception as storage_err: raise RuntimeError(f"Move file failed at storage layer: {str(storage_err)}") + if not moved: + raise RuntimeError("Move file failed at storage layer") updates["parent_id"] = dest_folder_entry.id updates["location"] = new_location