[Twisted-Python] deferredGenerator ad errbacks

Manlio Perillo manlio_perillo at libero.it
Sat Apr 15 09:21:39 MDT 2006


Christopher Armstrong ha scritto:
> On 4/15/06, *Manlio Perillo* <manlio_perillo at libero.it
> <mailto:manlio_perillo at libero.it>> wrote:
> 
>     from twisted.internet import defer, reactor
> 
> [...]
>     @defer.deferredGenerator
>     def generator():
>         d = defer.waitForDeferred( defer.succeed(1))
>         yield d
> 
>         d = defer.waitForDeferred(defer.fail(Exception("error 1")))
>         yield d
> 
> [...]
>
> getResult() is the thing that (either returns a result or) raises any
> exceptions that a Deferred has failed with, so it's important to always
> call it.
> 

Ok, thanks; I'm sorry to have missed it.


Regards  Manlio Perillo




More information about the Twisted-Python mailing list