Merge pull request #697 from JakeStanger/refactor/dbus-error

refactor(mpris): better logging, avoid panic on dbus error
This commit is contained in:
Jake Stanger 2024-08-10 13:55:49 +01:00 committed by GitHub
commit bba345a13b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,9 +47,12 @@ impl Client {
)) if transport_error.name() == Some(NO_ACTIVE_PLAYER)
|| transport_error.name() == Some(NO_REPLY) =>
{
Vec::new()
vec![]
}
_ => {
error!("D-Bus error getting MPRIS players: {e:?}");
vec![]
}
_ => panic!("Failed to connect to D-Bus"),
});
// Acquire the lock of current_player before players to avoid deadlock.
// There are places where we lock on current_player and players, but we always lock on current_player first.