def exception(self)
try:
Something.objects.all()
except Exception, err:
print err.message #(if you want)
#raise err
raise # The 'raise' statement with no arguments inside an error
# handler tells Python to re-raise the exception with the
# original traceback intact
在错误消息会告诉你例外的原因
Like the tutorial says.
您可能会发现^{} 很有用。在
traceback
模块的print_exc()
函数似乎就是您想要的。Docs相关问题 更多 >
编程相关推荐