Improve error message when example fails to run

This commit is contained in:
Richard Feldman 2020-04-07 08:29:16 -04:00
parent bba5385088
commit 30df69af4f

View file

@ -84,10 +84,13 @@ fn main() -> io::Result<()> {
.expect("rustc failed to run");
// Step 4: Run the compiled app
Command::new(cwd.join("app"))
.spawn()
.expect("./app failed to run");
Command::new(cwd.join("app")).spawn().unwrap_or_else(|err| {
panic!(
"{} failed to run: {:?}",
cwd.join("app").to_str().unwrap(),
err
)
});
Ok(())
}
None => {