Very, very close to want I wanted to understand, thank you! One more q please: what if I complicate the abc1() like following, is this expected to work or again I've missed the point?
return ( self.abc1(). addErrback(self.handleFailure1). addCallback(self.abc2,args). addCallback(self.abc3). addErrback(self.handleFailure2) ) def abc1(self): d = defer.Deferred() c = myClass() result = c.myTestFunc() if result != 1: d.addCallback(raiser) d.callback(result) return d def raiser(self, _): raise Exception("Error11") Quoting "Terry Jones" <te...@jon.es>: > If your code looked like this (pseudocode), you would see the exception > > return ( > self.abc1(). > addErrback(self.handleFailure1). > addCallback(self.abc2,args). > addCallback(self.abc3). > addErrback(self.handleFailure2) > ) > > def abc1(self): > d = defer.Deferred() > d.addCallback(raiser) > d.callback(1) > return d > > def raiser(self, _): > raise Exception("Error11") > > Because the thing that raises is being called by Twisted's deferred class, > and its exception is caught and routed to d's errback chain and winds up in > the handleFailure1 method. > > Does that make sense? > > Terry > > _______________________________________________ > Twisted-Python mailing list > Twisted-Python@twistedmatrix.com > http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python > _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python