# HG changeset patch
# User Ralph Meijer <ralphm@ik.nu>
# Date 1104697755 0
# Node ID f4d725a942022eb78842bf5677a67a858690d331
# Parent  b75fcc5543583bc1c06ecc56262dcb09748418d7
Fix bug in how errors are handled in disco info request.

diff -r b75fcc554358 -r f4d725a94202 idavoll/idavoll.py
--- 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
diff -r b75fcc554358 -r f4d725a94202 idavoll/pubsub.py
--- 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):