I'm using the following code to retrieve ThreadPoolExecutor worker exception:
def worker_done(worker):
if worker.exception():
print("worker exception: %s" % (worker.exception()))
worker = pool.submit(start_job)
worker.add_done_callback(worker_done)
The exception does not contain the error stack. How can I use traceback.format_exc()
here to retrieve a full exception?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…