comparison idavoll/pubsub.py @ 102:f4d725a94202

Fix bug in how errors are handled in disco info request.
author Ralph Meijer <ralphm@ik.nu>
date Sun, 02 Jan 2005 20:29:15 +0000
parents b75fcc554358
children d42327839888
comparison
equal deleted inserted replaced
101:b75fcc554358 102:f4d725a94202
137 if self.backend.supports_persistent_items(): 137 if self.backend.supports_persistent_items():
138 info.append(disco.Feature(NS_PUBSUB + "#persistent-items")) 138 info.append(disco.Feature(NS_PUBSUB + "#persistent-items"))
139 139
140 return defer.succeed(info) 140 return defer.succeed(info)
141 else: 141 else:
142 d = self.backend.get_node_type(node) 142 try:
143 d.addCallback(self._add_identity, [], node) 143 d = self.backend.get_node_type(node)
144 d.addErrback(lambda _: []) 144 d.addErrback(lambda _: [])
145 d.addCallback(self._add_identity, [], node)
146 except backend.NodeNotFound:
147 return defer.succeed([])
145 return d 148 return d
146 149
147 def _add_identity(self, node_type, result_list, node): 150 def _add_identity(self, node_type, result_list, node):
148 result_list.append(disco.Identity('pubsub', node_type)) 151 result_list.append(disco.Identity('pubsub', node_type))
149 d = self.backend.get_node_meta_data(node) 152 d = self.backend.get_node_meta_data(node)