Dear list,

I've found such a code example on "Stack Overflow" regarding errbacks:
___________________________

class YourExample(object):
    def your_example(self):
        self.agent = Agent(reactor, pool=pool)
        self.deferred = self.agent.request(
                'GET',
                self.url,
                Headers({'User-Agent': ['Mozilla/5.0']})
            )

        
self.deferred.addCallback(self.gotResponse).addErrback(self.gotBadResponse)
def gotBadResponse(self,raised):
    """you might have cleanup code here, or mark the url as bad in the
database, or something similar"""
    pass
__________________________

Normally only Failure object is passed to gotBadResponse() . I would
like to pass full response body to it - is it possible?
Do I have to encapsulate the response body inside Failure object?

Best regards

Maciek
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to