1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-17 14:51:04 +02:00

refactor(mpris): better logging, avoid panic on dbus error

This commit is contained in:
Jake Stanger 2024-08-10 13:41:22 +01:00
parent 860a6767f1
commit 189975791f
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61

View file

@ -47,9 +47,12 @@ impl Client {
)) if transport_error.name() == Some(NO_ACTIVE_PLAYER) )) if transport_error.name() == Some(NO_ACTIVE_PLAYER)
|| transport_error.name() == Some(NO_REPLY) => || 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. // 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. // There are places where we lock on current_player and players, but we always lock on current_player first.