The project I am working on is all written in Tornado, but I have included a bit of Twisted to deal with asynchronous XML-RPC. I was wondering if you can use Tornado\'s gen.engi
I modified Ben's sample code a bit in order to set exception correctly.
def wrap_deferred(deferred):
future = tornado.concurrent.TracebackFuture()
deferred.addCallback(future.set_result)
deferred.addErrback(lambda err: future.set_exception(err.value))
return future
twisted wrap exception as a failure.Failure. future.set_exception complains it is not an exception type.