[gnome-music/gnome-3-12] Trap OSTree errors when adding sources



commit 24e47f31f9a57aa0f0a9431334db1bda1550291a
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Tue Apr 1 17:06:23 2014 +0200

    Trap OSTree errors when adding sources
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727444

 gnomemusic/grilo.py |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)
---
diff --git a/gnomemusic/grilo.py b/gnomemusic/grilo.py
index 2b52037..aaa0f08 100644
--- a/gnomemusic/grilo.py
+++ b/gnomemusic/grilo.py
@@ -98,19 +98,22 @@ class Grilo(GObject.GObject):
 
     def _on_source_added(self, pluginRegistry, mediaSource):
         id = mediaSource.get_id()
-        if id == 'grl-tracker-source':
-            ops = mediaSource.supported_operations()
-            if ops & Grl.SupportedOps.SEARCH:
-                print('Detected new source available: \'%s\' and it supports search' %
-                      mediaSource.get_name())
-
-                self.sources[id] = mediaSource
-                self.tracker = mediaSource
-
-                if self.tracker is not None:
-                    self.emit('ready')
-                    self.tracker.notify_change_start()
-                    self.tracker.connect('content-changed', self._on_content_changed)
+        try:
+            if id == 'grl-tracker-source':
+                ops = mediaSource.supported_operations()
+                if ops & Grl.SupportedOps.SEARCH:
+                    print('Detected new source available: \'%s\' and it supports search' %
+                          mediaSource.get_name())
+
+                    self.sources[id] = mediaSource
+                    self.tracker = mediaSource
+
+                    if self.tracker is not None:
+                        self.emit('ready')
+                        self.tracker.notify_change_start()
+                        self.tracker.connect('content-changed', self._on_content_changed)
+        except Exception as e:
+            log.debug("Source %s: exception %s" % (id, e))
 
     def _on_source_removed(self, pluginRegistry, mediaSource):
         print('source removed')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]