[gnome-music/wip/jfelder/mpris-cleanup: 12/23] mpris: Replace exceptions with logger messages



commit e2d0712431a5d8a01185f0db63ffcde589d7c6e2
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 8084e969..6751c002 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -765,10 +765,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:
@@ -792,10 +790,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]