[Twisted-Python] Understanding deferred and error handling

Jason Heeris jason.heeris at gmail.com
Wed Apr 20 00:41:11 EDT 2011


On 20 April 2011 12:28, David <david at silveregg.co.jp> wrote:
> This already bothers me at a fundamental level, because it means it is
> very easy to "swallow" errors without being aware of it. Is there a
> "systematic" solution to this issue, or am I condemned to handle errors
> systematically everywhere in my code ?

My approach is to (where appropriate) use "passthrough" type methods, eg.

    def stop(result):
        reactor.stop()
        return result

If you use that in your code, you should see straight away that the
unhandled Failure is logged.

— Jason



More information about the Twisted-Python mailing list