Merge pull request #684 from roderickvd/fix-onevent-panic

Log error instead of panicking when child fails to start
This commit is contained in:
Sasha Hilton 2021-05-01 01:18:05 +01:00 committed by GitHub
commit 8973d29837
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -768,7 +768,9 @@ async fn main() {
Some(event) => {
if let Some(program) = &setup.player_event_program {
if let Some(child) = run_program_on_events(event, program) {
let mut child = child.expect("program failed to start");
if child.is_ok() {
let mut child = child.unwrap();
tokio::spawn(async move {
match child.wait().await {
@ -777,6 +779,9 @@ async fn main() {
_ => {}
}
});
} else {
error!("program failed to start");
}
}
}
},