Re: [Twisted-Python] How to chain deferred calls

2009-10-22 Thread vitaly
This is it! Thank you. Quoting "Andrew Bennetts" : > vit...@synapticvision.com wrote: > [...] >> def abc1(self): >> if t.test() is None: >>raise Exception("Error11") >> else: >>d = defer.Deferred() >>d.callback(1) >>return d >> >> >> and basically, I've

Re: [Twisted-Python] How to chain deferred calls

2009-10-22 Thread vitaly
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,

Re: [Twisted-Python] How to chain deferred calls

2009-10-22 Thread Andrew Bennetts
vit...@synapticvision.com wrote: [...] > def abc1(self): > if t.test() is None: >raise Exception("Error11") > else: >d = defer.Deferred() >d.callback(1) >return d > > > and basically, I've expected in case of exception > self.handleFailure1() to be call

Re: [Twisted-Python] How to chain deferred calls

2009-10-22 Thread Terry Jones
> "vitaly" == vitaly writes: vitaly> Thank you a lot for pointing me to the Twisted doc-s, but we're vitaly> discussing the following snippet: [snip] vitaly> and basically, I've expected in case of exception vitaly> self.handleFailure1() to be called, but I don't see it happen. The reason y

Re: [Twisted-Python] How to chain deferred calls

2009-10-22 Thread vitaly
Thank you a lot for pointing me to the Twisted doc-s, but we're discussing the following snippet: return ( self.abc1(). addErrback(self.handleFailure1). addCallback(self.abc2,args). addCallback(self.abc3). addErrback(self.handleFailure2) ) def abc1(self): if t.te

Re: [Twisted-Python] How to chain deferred calls

2009-10-22 Thread Paul Goins
Hello, >>> On Oct 21, 2009, at 4:12 PM, vit...@synapticvision.com wrote: >>> hi, how can I chain in defer methods that could raise exception while showing the exception that coming from method? This is covered in the Twisted documentation. There's 3 pages I often have reviewed whe

Re: [Twisted-Python] How to chain deferred calls

2009-10-22 Thread vitaly
twistedmatrix.com] On Behalf Of > vit...@synapticvision.com > Sent: Thursday, October 22, 2009 6:38 PM > To: twisted-python@twistedmatrix.com > Subject: Re: [Twisted-Python] How to chain deferred calls > > > me too, > may be its because of the way I'm calling the chain

Re: [Twisted-Python] How to chain deferred calls

2009-10-22 Thread Valeriy Pogrebitskiy
009 6:38 PM To: twisted-python@twistedmatrix.com Subject: Re: [Twisted-Python] How to chain deferred calls me too, may be its because of the way I'm calling the chain: return ( self.abc1(). addErrback(self.handleFailure1). addCallback(self.abc2,args). addCallback(self.abc3).

Re: [Twisted-Python] How to chain deferred calls

2009-10-22 Thread vitaly
2:02 PM > To: twisted-python@twistedmatrix.com > Subject: Re: [Twisted-Python] How to chain deferred calls > > > Thank you for response. > > the issue is if adc1() will raise up an exception, than following it > .addErrback() will never be called cause adc1() will exit or

Re: [Twisted-Python] How to chain deferred calls

2009-10-22 Thread Valeriy Pogrebitskiy
: twisted-python-boun...@twistedmatrix.com [mailto:twisted-python-boun...@twistedmatrix.com] On Behalf Of vit...@synapticvision.com Sent: Thursday, October 22, 2009 2:02 PM To: twisted-python@twistedmatrix.com Subject: Re: [Twisted-Python] How to chain deferred calls Thank you for response. the issue

Re: [Twisted-Python] How to chain deferred calls

2009-10-22 Thread vitaly
Thank you for response. the issue is if adc1() will raise up an exception, than following it .addErrback() will never be called cause adc1() will exit or raise Exception. Quoting "Valeriy Pogrebitskiy" : > Add another .addErrback() directly after adc1() - to handle that > specific exception

Re: [Twisted-Python] How to chain deferred calls

2009-10-21 Thread Valeriy Pogrebitskiy
Add another .addErrback() directly after adc1() - to handle that specific exception... Kind regards, Valeriy Pogrebitskiy vpogr...@verizon.net On Oct 21, 2009, at 4:12 PM, vit...@synapticvision.com wrote: > hi, > how can I chain in defer methods that could raise exception while > showing

[Twisted-Python] How to chain deferred calls

2009-10-21 Thread vitaly
hi, how can I chain in defer methods that could raise exception while showing the exception that coming from method? I mean, if I'll do: return ( adc1().abc2().abc3().addErrback("Common2AllException") ) than "Common2AllException" will be raised if abc1() raise Exception, but I'd like to see