def output_handle(callback):
messages = [outmsg.errors for outmsg in callback]
if len([out_msg for out_msg in messages if out_msg]) > 0:
tqdm.write(
' >> There were unhandled errors during this batch. Please check errors_pyScanArchive.log for details')
# function to print any error that are encountered during parallel execution
for msg in messages:
if msg:
f = open('errors_pyScanArchive.log','a')
f.write('ON ' + datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') + ' an unhandled error occurred:\n')
f.write(msg + '\n')
f.write('END OF ERROR =================== \n\n')
f.close()
return []
评论列表
文章目录