Fix error handling in initial connection.
authorTim Potter <tpot@hp.com>
Tue, 8 Apr 2008 03:13:46 +0000 (13:13 +1000)
committerTim Potter <tpot@hp.com>
Tue, 8 Apr 2008 03:13:46 +0000 (13:13 +1000)
Don't forget that addCallback(fn1) followed by addErrback(fn2) doesn't do
quite what you think.  Use addCallbacks(fn1, fn2) instead.

bbmodel.py

index d88fb38..9b22191 100644 (file)
@@ -133,8 +133,7 @@ class BBModel(pb.Referenceable):
         d = cf.login(creds)
         reactor.connectTCP(host, port, cf)
 
-        d.addCallback(self.connected)
-        d.addErrback(lambda arg: log.err(arg))
+        d.addCallbacks(self.connected, lambda arg: log.err(arg))
 
         log.msg('connecting to %s:%d as %s' % (host, port, username))