git.delta.rocks / jrsonnet / refs/commits / eae9921798a3

difftreelog

feat print command and status on failure

Yaroslav Bolyukin2021-09-18parent: #1f92baf.patch.diff
in: trunk

1 file changed

modifiedsrc/command.rsdiffbeforeafterboth
21 }21 }
2222
23 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 }
3536
36 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 }