[gnome-music] player: better discoverer error messages
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] player: better discoverer error messages
- Date: Mon, 19 Jan 2015 11:43:21 +0000 (UTC)
commit d94d1c36555f9fcb2aa72b86ef9082db158d23b5
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date: Mon Jan 19 12:43:12 2015 +0100
player: better discoverer error messages
gnomemusic/player.py | 2 +-
gnomemusic/view.py | 9 ++++++---
2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index ad28e84..0b3d9f8 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -167,7 +167,7 @@ class Player(GObject.GObject):
return
if not url.startswith("file://"):
- logger.debug("Skipping discovery of %s as a remote url" % url)
+ logger.debug("Skipping discovery of %s as not a local file" % url)
return
obj = (callback, data)
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index 9a7b87b..a43d000 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -208,8 +208,11 @@ class ViewContainer(Gtk.Stack):
@log
def _on_discovered(self, info, error, _iter):
if error:
- print("Info %s: error: %s" % (info, error))
- self._model.set(_iter, [8, 10], [self.errorIconName, True])
+ try:
+ logger.warn("File will be skipped: %s\n%s" % (error.message, info.get_uri()))
+ self._model.set(_iter, [8, 10], [self.errorIconName, True])
+ except Exception:
+ pass
@log
def _add_item(self, source, param, item, remaining=0, data=None):
@@ -231,7 +234,7 @@ class ViewContainer(Gtk.Stack):
try:
self.player.discoverer.discover_uri(item.get_url())
except:
- print('failed to discover url ' + item.get_url())
+ logger.warn('failed to discover url ' + item.get_url())
icon_name = self.errorIconName
self._model.set(_iter,
[0, 1, 2, 3, 4, 5, 7, 8, 9, 10],
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]