[gnome-music/wip/jfelder/mpris-cleanup: 3/29] 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: 3/29] mpris: Replace exceptions with logger messages
- Date: Mon, 8 Apr 2019 16:28:01 +0000 (UTC)
commit b622eae9873440a4fcc6d8634cbae5702a10a1d8
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 4954f28c..5ca35f34 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -769,10 +769,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:
@@ -796,10 +794,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]