From 4abb30c0850521193750d197d3b8d41ee8fbb558 Mon Sep 17 00:00:00 2001 From: janhencic Date: Wed, 21 Jan 2026 18:24:02 +0000 Subject: [PATCH] Use error in missing output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This update returns ColmenaError::BadOutput instead of unwrapping when capturing a command’s output in CommandExecution. --- src/util.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util.rs b/src/util.rs index ffbfef5..042d926 100644 --- a/src/util.rs +++ b/src/util.rs @@ -169,7 +169,9 @@ impl CommandExt for CommandExecution { self.run().await?; let (stdout, _) = self.get_logs(); - Ok(stdout.unwrap().to_owned()) + stdout.cloned().ok_or_else(|| ColmenaError::BadOutput { + output: "missing stdout from command".into(), + }) } /// Captures deserialized output from JSON.