diff --git a/apps/ai-game-creator-shell/src-tauri/src/editor_adapters/execution.rs b/apps/ai-game-creator-shell/src-tauri/src/editor_adapters/execution.rs index f9b87d922..46a151a0e 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/editor_adapters/execution.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/editor_adapters/execution.rs @@ -210,15 +210,15 @@ fn update_godot_authorized_project_at( if bytes.len() > 64 * 1024 { return Err("Godot 待清理项目归属超过限制".into()); } - let mut temporary = - tempfile::NamedTempFile::new_in(config).map_err(|_| "无法创建 Godot 项目归属记录")?; + let mut temporary = tempfile::NamedTempFile::new_in(config) + .map_err(|error| format!("无法创建 Godot 项目归属记录:{error}"))?; temporary .write_all(&bytes) .and_then(|_| temporary.as_file().sync_all()) - .map_err(|_| "无法持久保存 Godot 项目归属")?; + .map_err(|error| format!("无法持久保存 Godot 项目归属:{error}"))?; temporary .persist(config.join(GODOT_PROJECTS_FILE)) - .map_err(|_| "无法提交 Godot 项目归属记录")?; + .map_err(|error| format!("无法提交 Godot 项目归属记录:{}", error.error))?; Ok(()) } @@ -254,7 +254,7 @@ pub(crate) fn godot_project_cleanup_required(project: &Path) -> Result Ok(entries.next().is_some()), Err(error) if error.kind() == std::io::ErrorKind::NotFound => Ok(false), - Err(_) => Err("无法确认 Godot 桥缓存是否已清理".into()), + Err(error) => Err(format!("无法确认 Godot 桥缓存是否已清理:{error}")), } } @@ -266,7 +266,7 @@ fn remove_fence(path: &Path) -> Result<(), String> { match std::fs::remove_file(path) { Ok(()) => Ok(()), Err(error) if error.kind() == std::io::ErrorKind::NotFound => Ok(()), - Err(_) => Err("无法清理编辑器执行确认记录,继续阻断执行".into()), + Err(error) => Err(format!("无法清理编辑器执行确认记录:{error},继续阻断执行")), } } diff --git a/apps/ai-game-creator-shell/src-tauri/src/resource_preview_scheduler.rs b/apps/ai-game-creator-shell/src-tauri/src/resource_preview_scheduler.rs index 76668d039..f099d34d2 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/resource_preview_scheduler.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/resource_preview_scheduler.rs @@ -146,7 +146,7 @@ impl ProjectResourcePreviewReadManager { Ok(result) }) .await - .map_err(|_| "资源预览读取任务异常结束".to_string())?; + .map_err(|error| format!("资源预览读取任务异常结束:{error}"))?; result }