[Twisted-Python] addCallbacks issue

Sorin C. soso_pub at yahoo.com
Mon Apr 12 15:28:06 MDT 2004


Hi everyone,

I'm using PB in my application and I have problems
with addCallbacks call, it's not working as expected,
at least what I expect. The following snippet:

factory = pb.PBClientFactory()
reactor.connectTCP('localhost', 2174, factory)
d = factory.getRootObject()
d.addCallbacks(self.gotRoot, self.netError)

when an error occures self.netError doesn't get
called, instead I get something like: "Unhandled error
in Deferred:" which I assume is an error message
telling me that the deffered is not bound to an error
handler.

Now if I replace the last line like this:

factory = pb.PBClientFactory()
reactor.connectTCP('localhost', 2174, factory)
d = factory.getRootObject()
d.addCallback(self.gotRoot)
d.addErrback(self.netError)

the error handler gets called and everything is ok.

Any idea why addCallbacks fails to bound the error
handler? I use Twisted 1.2.0.

Thanks,
Sorin


__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html




More information about the Twisted-Python mailing list