From 77f4c77b5090f29bb15fa6720fbc06089808aa55 Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Fri, 4 Dec 2026 01:48:34 +0800 Subject: [PATCH] fix(profile): preserve storage recovery details in refresh errors --- src-tauri/src/cmd/profile.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src-tauri/src/cmd/profile.rs b/src-tauri/src/cmd/profile.rs index b6c807d8c..92936c299 100644 --- a/src-tauri/src/cmd/profile.rs +++ b/src-tauri/src/cmd/profile.rs @@ -143,13 +143,10 @@ pub async fn create_profile(item: ProfileCreate, file_data: Option) -> CmdResult { let index: String = index.into(); - match feat::update_profile(&index, option.as_ref(), true).await { - Ok(_) => Ok(()), - Err(e) => { - logging!(error, Type::Cmd, "update profile failed: {e:#}"); - Err(coded_error("PROFILE_UPDATE_FAILED", e)) - } - } + feat::update_profile(&index, option.as_ref(), true) + .await + .inspect_err(|e| logging!(error, Type::Cmd, "update profile failed: {e:#}")) + .with_error_code("PROFILE_UPDATE_FAILED") } #[tauri::command]