From 78a7b2d1bb81948544ff221d970befc64f0931d3 Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Sat, 25 Feb 2023 10:54:18 -0500 Subject: [PATCH] [F] Fix UTF8 encoding error --- backend/src/utils.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/utils.rs b/backend/src/utils.rs index f18da36..db63cd9 100644 --- a/backend/src/utils.rs +++ b/backend/src/utils.rs @@ -19,7 +19,8 @@ pub fn run_cmd(cmd: &str) -> Result { if !out.status.success() { error!("Command failed: {cmd}"); error!("Command output: {:?}", out); - bail!(String::from_utf8(out.stderr)?); + let msg = String::from_utf8_lossy(&out.stderr.to_owned()).to_string(); + bail!(msg); } // debug!("Command output: {:?}", out); Ok(out)