mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Merge pull request #684 from roderickvd/fix-onevent-panic
Log error instead of panicking when child fails to start
This commit is contained in:
commit
8973d29837
1 changed files with 13 additions and 8 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue