[Twisted-Python] Handling (intercepting) exceptions in twisted

Whenever an exception is raised, I would like to handle it instead of twisted so I can syslog and exit the application. Is there an excepthook for twisted that I can override to provide this functionality? Thanks, Joshua Moore-Oliva

On Sun, 2004-09-12 at 16:06, Joshua Moore-Oliva wrote:
Whenever an exception is raised, I would like to handle it instead of twisted so I can syslog and exit the application.
Is there an excepthook for twisted that I can override to provide this functionality?
Something along the lines of: def f(**kwargs): if kwargs.has_key("failure"): # do your thing twisted.python.log.addObserver(f) # f will get called on all logged messages. Note twisted has code (twisted.python.syslog) for hooking up the log system to syslog.

On Sun, 2004-09-12 at 16:06, Joshua Moore-Oliva wrote:
Whenever an exception is raised, I would like to handle it instead of twisted so I can syslog and exit the application.
Is there an excepthook for twisted that I can override to provide this functionality?
Something along the lines of: def f(**kwargs): if kwargs.has_key("failure"): # do your thing twisted.python.log.addObserver(f) # f will get called on all logged messages. Note twisted has code (twisted.python.syslog) for hooking up the log system to syslog.
participants (2)
-
Itamar Shtull-Trauring
-
Joshua Moore-Oliva