Re: [Twisted-Python] Passing additional arguments to errback

2013-09-06 Thread Phil Mayers
Maciej Wasilak 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 u

Re: [Twisted-Python] Passing additional arguments to errback

2013-09-06 Thread Maciej Wasilak
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 i

Re: [Twisted-Python] Passing additional arguments to errback

2013-09-05 Thread Laurens Van Houtven
On Thu, Sep 5, 2013 at 12:00 PM, Maciej Wasilak wrote: > Laurens, > > >> You don't have to do it from in there. You can do >> .addErrback(handleErrors, request), since it's all the same request object, >> right? >> > > Aaargh! I see the problem now. I wrote everything as part of the Protocol > c

Re: [Twisted-Python] Passing additional arguments to errback

2013-09-05 Thread Maciej Wasilak
Laurens, > You don't have to do it from in there. You can do > .addErrback(handleErrors, request), since it's all the same request object, > right? > Aaargh! I see the problem now. I wrote everything as part of the Protocol class (D&D - Deferreds&Dictionaries), when I should have extracted reque

Re: [Twisted-Python] Passing additional arguments to errback

2013-09-05 Thread Laurens Van Houtven
Hi, On Thu, Sep 5, 2013 at 9:24 AM, Maciej Wasilak wrote: > Thank you for your answer. I'm explicitly interested in the following > combination: > > > .addCallback(cb).addErrback(eb) > > If I understand correctly errback "eb" catches errors from both callback > "cb", and from agent.request (age

Re: [Twisted-Python] Passing additional arguments to errback

2013-09-05 Thread Maciej Wasilak
Laurens, > Cześć Cześć! :) Thank you for your answer. I'm explicitly interested in the following combination: > .addCallback(cb).addErrback(eb) If I understand correctly errback "eb" catches errors from both callback "cb", and from agent.request (agent.request errors pass through default empty

Re: [Twisted-Python] Passing additional arguments to errback

2013-09-04 Thread Laurens Van Houtven
Cześć Maciek :) In general, you can pass extra arguments when you call addCallback(s) or addErrback. They will get passed to the callback. However, as a side note to that code example, do you understand the difference between .addCallbacks(cb, eb) and: .addCallback(cb).addErrback(eb) and: .