[Twisted-Python] Error (and response) handling in protocols

Jason Heeris jason.heeris at gmail.com
Mon Feb 21 05:39:39 EST 2011


On 21 February 2011 15:58, Michael Thompson <michaelnt at gmail.com> wrote:
> The app should be waiting on the result of a deferred (which it
> expects to fire with the result of the serial comms) so you can simply
> errback that deferred.

I get that bit, but my question is essentially: what triggers the
errback? If the LineReceiver gets a line that's too long, *how* do I
errback on the deferred? Should the protocol hold the deferred? The
factory? Whatever creates the factory? Does it matter? ("No" would be
a fine answer to the last question, my whole problem is that I don't
really know the "Twisted" way to approach this, or if there even is
one.)

(I would ask: do I even need a factory? But the fact is that I do,
since all of the useful mixins and base classes rely on one being
present.)

— Jason



More information about the Twisted-Python mailing list