add details fetch log

This commit is contained in:
Julian Freeman
2026-04-04 18:08:50 -04:00
parent fd8241fd43
commit 86df026091

View File

@@ -493,9 +493,19 @@ pub fn run() {
let client = reqwest::Client::new();
if let Ok(resp) = client.get(&url).timeout(std::time::Duration::from_secs(10)).send().await {
if resp.status().is_success() {
if let Ok(steps) = resp.json::<Vec<PostInstallStep>>().await {
final_steps = Some(steps);
if let Ok(text) = resp.text().await {
match serde_json::from_str::<Vec<PostInstallStep>>(&text) {
Ok(steps) => {
emit_log(&handle, &log_id, "Post-Install", &format!("Successfully fetched remote config with {} steps.", steps.len()), "info");
final_steps = Some(steps);
},
Err(e) => {
emit_log(&handle, &log_id, "Post-Install Error", &format!("JSON Parse Error: {}. Raw Content: {}", e, text), "error");
}
}
}
} else {
emit_log(&handle, &log_id, "Post-Install Error", &format!("Remote config HTTP Error: {}", resp.status()), "error");
}
}
}