> > [SNIP] > > The “Unhanded error in Deferred” isn’t coming from your call to > deferToThread, it is coming from your task.LoopingCall. When you > invoke .start() on your LoopingCall instance, it returns a Deferred, > which fires its assigned callback handler when you call .stop() on > the LoopingCall instance, and which fires its assigned errback > handler if an exception occurs while running the function (in this > case runEverySecond) passed to the LoopingCall. > > In other words, you need this: > > l = task.LoopingCall(runEverySecond, ‘lala’) > l.addErrback(printError) >
you probably meant: l = task.LoopingCall(runEverySecond, 'lala') d = l.start(1.0) d.addErrback(printError) your version gives me a attribute error, thanks for clarifying that. _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python