add details fetch log
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user