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 d88fb381e4d3f7ea24bd08deac177f21822c7365..9b221914d67e167735afe6668d710dac92dec6a7 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))