difftreelog
feat print command and status on failure
in: trunk
1 file changed
src/command.rsdiffbeforeafterboth21 }21 }222223 fn run(&mut self) -> Result<()> {23 fn run(&mut self) -> Result<()> {24 self.inherit_stdio();24 let out = self.output()?;25 let out = self.output()?;25 if !out.status.success() {26 if !out.status.success() {26 anyhow::bail!("command failed with status {}", out.status);27 anyhow::bail!("command ({:?}) failed with status {}", self, out.status);27 }28 }28 Ok(())29 Ok(())29 }30 }34 }35 }353636 fn run_string(&mut self) -> Result<String> {37 fn run_string(&mut self) -> Result<String> {38 self.inherit_stdio();37 let out = self.output()?;39 let out = self.output()?;38 if !out.status.success() {40 if !out.status.success() {39 anyhow::bail!("command failed");41 anyhow::bail!("command ({:?}) failed with status {}", self, out.status);40 }42 }41 Ok(String::from_utf8(out.stdout)?)43 Ok(String::from_utf8(out.stdout)?)42 }44 }