[gnome-music/gnome-3-14] player: better discoverer error messages
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/gnome-3-14] player: better discoverer error messages
- Date: Mon, 19 Jan 2015 12:11:01 +0000 (UTC)
commit d417a4eb48ab39e7f2e1e6309058a67968cca042
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 3c6e03e..11e94ce 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -117,7 +117,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 f30d5b7..fdafcc2 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -270,8 +270,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):
@@ -291,7 +294,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]