[Twisted-Python] Re: Making DeferredList look like Deferred

Lenny G Arbage alengarbage at yahoo.com
Mon Feb 6 10:39:35 EST 2006


Thomas HERVE therve at free.fr wrote:
>>    def iterfail(err, i):
>>        print "  %i failed" % i
>
> The problem is here. You add an errback to your
defer,
> but you stop the error propagation by not returning
> err. Either do 'return err' or not
> 'addErrback(iterfail)'.


  Thomas, thanks for the response.  I thought that
might be it, but no avail.  If I 'return err' in
iterfail, I get:

in testdlist
  deferred will fail in 2s
  deferred will succeed in 2s
  0 failed
failed: testdlist
Unhandled error in Deferred:
Traceback (most recent call last):
Failure: <type 'bool'>: True
  1 succeeded


  If I instead comment out 'addErrback(iterfail,i)', I
get:

in testdlist
  deferred will fail in 2s
  deferred will succeed in 2s
failed: testdlist
Unhandled error in Deferred:
Traceback (most recent call last):
Failure: <type 'bool'>: True
  1 succeeded


  I don't know why the error is unhandled in either
case -- the DeferredList has an errback set.  (If I
raise a new error in iterfail, the same result occurs,
naturally).  It also doesn't seem to matter whether I
add 'fireOnOneErrBack' to the DeferredList constructor
or not.  Any ideas?  Does this code behave differently
on your machine?

Thanks,
Lenny

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the Twisted-Python mailing list