changeset 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 e7349d94d0c3
files idavoll/idavoll.py idavoll/pubsub.py
diffstat 2 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/idavoll/idavoll.py	Sun Jan 02 20:10:02 2005 +0000
+++ b/idavoll/idavoll.py	Sun Jan 02 20:29:15 2005 +0000
@@ -53,8 +53,8 @@
                 if hasattr(c, "get_disco_info"):
                     dl.append(c.get_disco_info(node))
         d = defer.DeferredList(dl, fireOnOneErrback=1, consumeErrors=1)
+        d.addErrback(self._error, iq)
         d.addCallback(self._disco_info_results, iq, node)
-        d.addErrback(self._error, iq)
         d.addCallback(self.send)
 
         iq.handled = True
@@ -92,8 +92,8 @@
                 if hasattr(c, "get_disco_items"):
                     dl.append(c.get_disco_items(node))
         d = defer.DeferredList(dl, fireOnOneErrback=1, consumeErrors=1)
+        d.addErrback(self._error, iq)
         d.addCallback(self._disco_items_result, iq, node)
-        d.addErrback(self._error, iq)
         d.addCallback(self.send)
         
         iq.handled = True
--- a/idavoll/pubsub.py	Sun Jan 02 20:10:02 2005 +0000
+++ b/idavoll/pubsub.py	Sun Jan 02 20:29:15 2005 +0000
@@ -139,9 +139,12 @@
 
             return defer.succeed(info)
         else:
-            d = self.backend.get_node_type(node)
-            d.addCallback(self._add_identity, [], node)
-            d.addErrback(lambda _: [])
+            try:
+                d = self.backend.get_node_type(node)
+                d.addErrback(lambda _: [])
+                d.addCallback(self._add_identity, [], node)
+            except backend.NodeNotFound:
+                return defer.succeed([])
             return d
 
     def _add_identity(self, node_type, result_list, node):