Log error instead of panicking when child fails to start
@@ -639,8 +639,9 @@ impl Future for Main {
progress = true;
if let Some(ref program) = self.player_event_program {
if let Some(child) = run_program_on_events(event, program) {
+ if child.is_ok() {
let child = child
- .expect("program failed to start")
+ .unwrap()
.map(|status| {
if !status.success() {
error!("child exited with status {:?}", status.code());
@@ -649,6 +650,9 @@ impl Future for Main {
.map_err(|e| error!("failed to wait on child process: {}", e));
self.handle.spawn(child);
+ } else {
+ error!("{:?} failed to start", program);
+ }
}
}
}
