try:
# code here
except Exception, err:
sys.stderr.write('ERROR: %s\n' % str(err))
import traceback
traceback.print_exc()
else:
# normal
finally:
###
Refer:
Python Exception Handling Techniques
traceback — Print or retrieve a stack traceback
没有评论:
发表评论