changeset 3017:e7cbe662838b

quick frontend (app): show an info log if avatar is not found instead of raising exception fix 288
author Goffi <goffi@goffi.org>
date Sat, 20 Jul 2019 16:03:28 +0200 (2019-07-20)
parents 0b1c17c24bba
children 758bee45612b
files sat_frontends/quick_frontend/quick_app.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sat_frontends/quick_frontend/quick_app.py	Fri Jul 19 23:04:35 2019 +0200
+++ b/sat_frontends/quick_frontend/quick_app.py	Sat Jul 20 16:03:28 2019 +0200
@@ -1346,8 +1346,12 @@
         contact_list.setCache(entity, "avatar", path)
         self.callListeners("avatar", entity, path, profile=profile)
 
-    def _avatarGetEb(self, failure, entity, contact_list):
-        log.warning(u"Can't get avatar: {}".format(failure))
+    def _avatarGetEb(self, failure_, entity, contact_list):
+        # FIXME: bridge needs a proper error handling
+        if "NotFound" in unicode(failure_):
+            log.info(u"No avatar found for {entity}".format(entity=entity))
+        else:
+            log.warning(u"Can't get avatar: {}".format(failure_))
         contact_list.setCache(entity, "avatar", self.getDefaultAvatar(entity))
 
     def getAvatar(