changeset 948:c20ac29d869f

pages (common/blog): don't fail if an error is raised while getting comment
author Goffi <goffi@goffi.org>
date Tue, 23 May 2017 00:06:03 +0200
parents 92f0eeb6dc72
children 36e9747520fd
files src/pages/common/blog/page_meta.py
diffstat 1 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/pages/common/blog/page_meta.py	Tue May 23 00:06:00 2017 +0200
+++ b/src/pages/common/blog/page_meta.py	Tue May 23 00:06:03 2017 +0200
@@ -57,13 +57,21 @@
         for comment_data in blog_item.comments:
             service = comment_data[u'service']
             node = comment_data[u'node']
-            comments_data = yield self.host.bridge.mbGet(
-                                  service,
-                                  node,
-                                  C.NO_LIMIT,
-                                  [],
-                                  {},
-                                  profile)
+            try:
+                comments_data = yield self.host.bridge.mbGet(
+                                      service,
+                                      node,
+                                      C.NO_LIMIT,
+                                      [],
+                                      {},
+                                      profile)
+            except Exception as e:
+                log.warning(_(u"Can't get comments at {node} (service: {service}): {msg}").format(
+                    service=service,
+                    node=node,
+                    msg=e))
+                continue
+
             comments = data_objects.BlogItems(comments_data)
             blog_item.appendCommentsItems(comments)
             yield appendComments(self, comments, identities, profile)