From e57e8b5f794500746ce6ced3674628cb5a839e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 19 Apr 2017 10:23:18 +1200 Subject: [PATCH] Better error handling Probably help debugging (see comments on #25) --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 51c35b3..4b2bd31 100644 --- a/src/main.rs +++ b/src/main.rs @@ -138,6 +138,12 @@ fn main() { env_logger::init().unwrap(); let opts = get_options(&matches); - let status = Command::new("watchexec").args(&opts).status(); - info!("Exit status: {:?}", status); + let status = Command::new("watchexec") + .args(&opts) + .status() + .expect("Failed to execute watchexec! Make sure it's installed and in your PATH."); + + if !status.success() { + error!("Oh no! Watchexec exited with: {}", status); + } }