[Twisted-Python] How do I get the reactor to stop on an exception

Itamar Shtull-Trauring itamar at itamarst.org
Tue Jun 3 17:40:15 EDT 2008

> I'm running a rather involved simulation using twisted, and it would be
> preferable if I could get the reactor to just drop me into the
> interpreter on any exception so I could examine the current state of
> things.

When using twistd or trial, you can simply use the debug command-line
option for that (-b). Without those,
twisted.python.failure.setDebugMode(True) or something, I forget the exact

Both of these only go into debugger on Failure creation, but that's
essentially any exception that goes into a Deferred or into the logging
system, so virtually any exception you're likely to care about.

More information about the Twisted-Python mailing list