Python

官方文档:https://docs.python.org/3/library/exceptions.html

1. 使用try...except...

2. 输出错误信息的方式为:

try:
    cursor.execute(sql)
    db.commit()
except Exception as inst:
    print(inst.args)
    db.rollback()

3. 

原文地址:https://www.cnblogs.com/qijiage/p/5850999.html