changeset 826:70939916dc80

server (blog): added unhandler errback in getItemById
author Goffi <goffi@goffi.org>
date Fri, 08 Jan 2016 19:50:40 +0100
parents a3e888ac4964
children f1fc7245b910
files src/server/blog.py
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/server/blog.py	Fri Jan 08 19:48:29 2016 +0100
+++ b/src/server/blog.py	Fri Jan 08 19:50:40 2016 +0100
@@ -287,16 +287,22 @@
                 max_comments = 0
                 # TODO: use max_comments only when RSM is not available
                 self.host.bridge.mbGet(item['comments_service'], item['comments_node'], max_comments, [],
-                                       extra_comments_dict, C.SERVICE_PROFILE, callback=gotComments)
+                    extra_comments_dict, C.SERVICE_PROFILE,
+                    callback=gotComments,
+                    errback=lambda failure: self.renderError(failure, request, pub_jid))
 
             # XXX: retrieve RSM information related to the main item. We can't do it while
             # retrieving the item, because item_ids and rsm should not be used together.
             self.host.bridge.mbGet(pub_jid.userhost(), '', 0, [],
-                                   {"rsm_max": "1", "rsm_after": item["id"]}, C.SERVICE_PROFILE, callback=gotMetadata)
+                {"rsm_max": "1", "rsm_after": item["id"]}, C.SERVICE_PROFILE,
+                callback=gotMetadata,
+                errback=lambda failure: self.renderError(failure, request, pub_jid))
 
         # get the main item
-        self.host.bridge.mbGet(pub_jid.userhost(), '', 1, [item_id],
-                               extra_dict, C.SERVICE_PROFILE, callback=gotItems)
+        self.host.bridge.mbGet(pub_jid.userhost(), '', 0, [item_id],
+            extra_dict, C.SERVICE_PROFILE,
+            callback=gotItems,
+            errback=lambda failure: self.renderError(failure, request, pub_jid))
 
     def getItems(self, pub_jid, max_items, extra_dict, extra_comments_dict, request, profile):
         """