[Twisted-Python] Passing additional arguments to errback

Phil Mayers p.mayers at imperial.ac.uk
Fri Sep 6 15:11:03 MDT 2013


Maciej Wasilak <wasilak at gmail.com> wrote:
>Hello,
>
>just one more question:
>
>Well, yes, you should, but still keep in mind that you can actually
>just
>> pass the request like so:
>>
>> .addErrback(handleErrors, request)
>>
>> You don't really have to save the request itself anywhere as an
>attribute.
>>
>
>if I understand correctly, when I put this instruction into my
>callback,
>then the errback will catch errors only from the callback, and not from
>agent.request, right? Such code seems hard to debug. Is this the
>standard
>procedure in Twisted to add callbacks/errbacks inside other callbacks?
>Best Regards
>Maciek
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Twisted-Python mailing list
>Twisted-Python at twistedmatrix.com
>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

No it'll catch errors from anything previous in the chain - either the agent call or the callback. If you read the docs carefully this should be clear.
-- 
Sent from my phone with, please excuse brevity and typos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20130906/189093ae/attachment.html>


More information about the Twisted-Python mailing list