[gnome-music/wip/jfelder/mpris-small-cleanups: 1/3] 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-small-cleanups: 1/3] mpris: Replace exceptions with logger messages
- Date: Wed, 29 May 2019 12:17:27 +0000 (UTC)
commit b3573bfd3079a7e1ae14a5d3386867f20ab20847
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 76f659a5..bc17689c 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -736,10 +736,8 @@ class MediaPlayer2Service(Server):
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 == MediaPlayer2Service.MEDIA_PLAYER2_IFACE:
@@ -761,10 +759,8 @@ class MediaPlayer2Service(Server):
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]