diff --git a/apps/ai-game-creator-shell/src-tauri/src/game_distribution_publish.rs b/apps/ai-game-creator-shell/src-tauri/src/game_distribution_publish.rs index c3b2aabf9..b4bf84b03 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/game_distribution_publish.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/game_distribution_publish.rs @@ -195,8 +195,8 @@ fn response_data(body: &str) -> Result { if value.get("ok").and_then(Value::as_bool) == Some(false) { let (code, message) = parse_error_payload(body); return Err(message - .or(code) .filter(|detail| !detail.trim().is_empty()) + .or_else(|| code.filter(|detail| !detail.trim().is_empty())) .unwrap_or_else(|| "服务器未返回错误信息".to_string())); } Ok(value.get("data").cloned().unwrap_or(value)) @@ -215,8 +215,8 @@ fn map_http_error(status: StatusCode, body: &str, fallback: &str) -> String { ); } let detail = message - .or(code) .filter(|value| !value.trim().is_empty()) + .or_else(|| code.filter(|value| !value.trim().is_empty())) .unwrap_or_else(|| format!("HTTP {}", status.as_u16())); format!("{fallback}:{detail}") }