Python - peewee - 调试语句 - 错误记录在哪里
Python - peewee - Debugging statements - where are the errors logged
我刚开始在 python 中使用 peewee。但是当我使用 .save() 函数保存 table 数据时。行中有错误。并且控制不会转到下一行。
只是想知道怎么才能知道是什么错误。虽然我已经缩小到下面的行
try:
with database.transaction():
driver = Driver()
driver.person = person
driver.qualification = form.getvalue('qualification')
driver.number = form.getvalue('phone')
driver.license = form.getvalue('issu')
driver.audited_by = 0
print "this line prints"
driver.save()
print "this one does not print"
print "Success"
except:
print "Error"
我使用了打印语句,我能够找出行 driver.save() 中的错误。但是如何检查到底是什么错误呢?
我刚开始在 python 中使用 peewee。但是当我使用 .save() 函数保存 table 数据时。行中有错误。并且控制不会转到下一行。
只是想知道怎么才能知道是什么错误。虽然我已经缩小到下面的行
try:
with database.transaction():
driver = Driver()
driver.person = person
driver.qualification = form.getvalue('qualification')
driver.number = form.getvalue('phone')
driver.license = form.getvalue('issu')
driver.audited_by = 0
print "this line prints"
driver.save()
print "this one does not print"
print "Success"
except:
print "Error"
我使用了打印语句,我能够找出行 driver.save() 中的错误。但是如何检查到底是什么错误呢?