fix(profile): preserve storage recovery details in refresh errors

This commit is contained in:
Tunglies
2026-12-04 01:48:34 +08:00
parent 338c3f67fa
commit 77f4c77b50
+4 -7
View File
@@ -143,13 +143,10 @@ pub async fn create_profile(item: ProfileCreate, file_data: Option<std::string::
#[specta::specta]
pub async fn update_profile(index: std::string::String, option: Option<PrfOption>) -> 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]