我编写了一个程序,该程序具有一个从主程序定期调用的协程,ioloop如下所示:from tornado import ioloop, web, gen, logtornado.log.enable_pretty_printing()import logging; logging.basicConfig()@gen.coroutinedef callback(): print 'get ready for an error...' raise Exception() result = yield gen.Task(my_async_func)l = ioloop.IOLoop.instance()cb = ioloop.PeriodicCallback(callback, 1000, io_loop=l)cb.startl.start()我得到的输出很简单:$ python2 app.pyget ready for an error...get ready for an error...get ready for an error...get ready for an error...将raise Exception()被自动忽略!如果我将回调更改为def callback(): print 'get ready for an error...' raise Exception()我得到了我期望(和需要)的完整堆栈跟踪。使用协程时如何获取堆栈跟踪?
添加回答
举报
0/150
提交
取消