mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Log error instead of panicking when child fails to start
This commit is contained in:
parent
56f1fb6dae
commit
0149725d77
1 changed files with 13 additions and 9 deletions
22
src/main.rs
22
src/main.rs
|
@ -639,16 +639,20 @@ impl Future for Main {
|
||||||
progress = true;
|
progress = true;
|
||||||
if let Some(ref program) = self.player_event_program {
|
if let Some(ref program) = self.player_event_program {
|
||||||
if let Some(child) = run_program_on_events(event, program) {
|
if let Some(child) = run_program_on_events(event, program) {
|
||||||
let child = child
|
if child.is_ok() {
|
||||||
.expect("program failed to start")
|
let child = child
|
||||||
.map(|status| {
|
.unwrap()
|
||||||
if !status.success() {
|
.map(|status| {
|
||||||
error!("child exited with status {:?}", status.code());
|
if !status.success() {
|
||||||
}
|
error!("child exited with status {:?}", status.code());
|
||||||
})
|
}
|
||||||
.map_err(|e| error!("failed to wait on child process: {}", e));
|
})
|
||||||
|
.map_err(|e| error!("failed to wait on child process: {}", e));
|
||||||
|
|
||||||
self.handle.spawn(child);
|
self.handle.spawn(child);
|
||||||
|
} else {
|
||||||
|
error!("{:?} failed to start", program);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue