From f88f190386f162226078633cf33b95d39fa27571 Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Fri, 25 Aug 2023 22:11:49 -0700 Subject: [PATCH] added yet more logging --- status_cloud/src/main.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/status_cloud/src/main.rs b/status_cloud/src/main.rs index 754d993..602a8de 100644 --- a/status_cloud/src/main.rs +++ b/status_cloud/src/main.rs @@ -65,9 +65,21 @@ fn main() -> Result<(), Box> { let mut drive_temps: Vec = vec![]; for drive in drives { - let output = Command::new("hddtemp").arg(drive).output()?; - - let tmp = std::str::from_utf8(&output.stdout)?.to_string(); + let output = match Command::new("hddtemp").arg(drive).output() { + Ok(val) => val, + Err(e) => { + println!("Error running hddtemp: {}", e.to_string()); + return Ok(()); + } + }; + + let tmp = match std::str::from_utf8(&output.stdout) { + Ok(val) => val, + Err(e) => { + println!("Error parsing hddtemp output: {}", e.to_string()); + return Ok(()); + } + }.to_string(); if !tmp.contains("sensor") { drive_temps.push(tmp.replace("\n", "Not running as sudo?"));