Skip to content

Commit

Permalink
fix: Provide consisten spawn failure message
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed Page committed Apr 6, 2021
1 parent 454648d commit 8a1bdc1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cmd.rs
Expand Up @@ -551,7 +551,12 @@ impl<'c> OutputOkExt for &'c mut Command {

impl<'c> OutputAssertExt for &'c mut Command {
fn assert(self) -> Assert {
let output = self.output().unwrap();
let output = match self.output() {
Ok(output) => output,
Err(err) => {
panic!("Failed to spawn {:?}: {}", self, err);
}
};
let assert = Assert::new(output).append_context("command", format!("{:?}", self.cmd));
if let Some(stdin) = self.stdin.as_ref() {
assert.append_context("stdin", DebugBuffer::new(stdin.clone()))
Expand Down

0 comments on commit 8a1bdc1

Please sign in to comment.