[gnome-music/wip/jfelder/mpris-cleanup: 43/67] mpris: Replace exceptions with logger messages
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/mpris-cleanup: 43/67] mpris: Replace exceptions with logger messages
- Date: Fri, 5 Apr 2019 20:09:34 +0000 (UTC)
commit a1602454a442b76547606e1ba197649e7867a51d
Author: Jean Felder <jfelder src gnome org>
Date: Tue Oct 16 23:18:17 2018 +0200
mpris: Replace exceptions with logger messages
gnomemusic/mpris.py | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 64cecb52..5998037a 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -768,10 +768,8 @@ class MPRIS(DBusInterface):
elif interface_name == 'org.freedesktop.DBus.Introspectable':
return {}
else:
- raise Exception(
- 'org.mpris.MediaPlayer2.GnomeMusic',
- 'This object does not implement the %s interface'
- % interface_name)
+ logger.warning(
+ "MPRIS does not implement {} interface".format(interface_name))
def Set(self, interface_name, property_name, new_value):
if interface_name == MPRIS.MEDIA_PLAYER2_IFACE:
@@ -795,10 +793,8 @@ class MPRIS(DBusInterface):
else:
self.player.props.repeat_mode = RepeatMode.NONE
else:
- raise Exception(
- 'org.mpris.MediaPlayer2.GnomeMusic',
- 'This object does not implement the %s interface'
- % interface_name)
+ logger.warning(
+ "MPRIS does not implement {} interface".format(interface_name))
def PropertiesChanged(self, interface_name, changed_properties,
invalidated_properties):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]