[Twisted-Python] global exception handler

Zoran Bosnjak zoran.bosnjak at sloveniacontrol.si
Thu Aug 12 06:26:19 MDT 2010


Hello all,
is there a possibility to have a global (application wide) exception
handler in twisted application? I would like to stop application in case
of any unhandled error in deferred callbacks.

If application is run from twistd ..., is it correct to stop application
like this?

def quit(failure):
  log.err(str(failure))
  reactor.callWhenRunning(reactor.stop)

But the main problem is how to get this method called if exception is
not handled by explicitly doing d.addErrback for each case.

Zoran





More information about the Twisted-Python mailing list