Mercurial > libervia-web
comparison src/server/blog.py @ 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 |
comparison
equal
deleted
inserted
replaced
825:a3e888ac4964 | 826:70939916dc80 |
---|---|
285 # get the comments | 285 # get the comments |
286 # max_comments = int(extra_comments_dict['rsm_max']) # FIXME | 286 # max_comments = int(extra_comments_dict['rsm_max']) # FIXME |
287 max_comments = 0 | 287 max_comments = 0 |
288 # TODO: use max_comments only when RSM is not available | 288 # TODO: use max_comments only when RSM is not available |
289 self.host.bridge.mbGet(item['comments_service'], item['comments_node'], max_comments, [], | 289 self.host.bridge.mbGet(item['comments_service'], item['comments_node'], max_comments, [], |
290 extra_comments_dict, C.SERVICE_PROFILE, callback=gotComments) | 290 extra_comments_dict, C.SERVICE_PROFILE, |
291 callback=gotComments, | |
292 errback=lambda failure: self.renderError(failure, request, pub_jid)) | |
291 | 293 |
292 # XXX: retrieve RSM information related to the main item. We can't do it while | 294 # XXX: retrieve RSM information related to the main item. We can't do it while |
293 # retrieving the item, because item_ids and rsm should not be used together. | 295 # retrieving the item, because item_ids and rsm should not be used together. |
294 self.host.bridge.mbGet(pub_jid.userhost(), '', 0, [], | 296 self.host.bridge.mbGet(pub_jid.userhost(), '', 0, [], |
295 {"rsm_max": "1", "rsm_after": item["id"]}, C.SERVICE_PROFILE, callback=gotMetadata) | 297 {"rsm_max": "1", "rsm_after": item["id"]}, C.SERVICE_PROFILE, |
298 callback=gotMetadata, | |
299 errback=lambda failure: self.renderError(failure, request, pub_jid)) | |
296 | 300 |
297 # get the main item | 301 # get the main item |
298 self.host.bridge.mbGet(pub_jid.userhost(), '', 1, [item_id], | 302 self.host.bridge.mbGet(pub_jid.userhost(), '', 0, [item_id], |
299 extra_dict, C.SERVICE_PROFILE, callback=gotItems) | 303 extra_dict, C.SERVICE_PROFILE, |
304 callback=gotItems, | |
305 errback=lambda failure: self.renderError(failure, request, pub_jid)) | |
300 | 306 |
301 def getItems(self, pub_jid, max_items, extra_dict, extra_comments_dict, request, profile): | 307 def getItems(self, pub_jid, max_items, extra_dict, extra_comments_dict, request, profile): |
302 """ | 308 """ |
303 | 309 |
304 @param pub_jid (jid.JID): publisher JID | 310 @param pub_jid (jid.JID): publisher JID |