【发布时间】:2014-07-01 13:07:05
【问题描述】:
在我看来,我抛出了一个错误,尤其是这个:
views.py
from xmlrpclib import Fault
def some_function(request):
if ....:
return Fault(-1, 'foo')
然后,同样在 views.py 中,我有我的自定义 500 处理程序来捕获服务器错误:
def my_custom_500(request):
context = {...}
### Here is where I need to catch `'foo'`
### in order to put it in the context and pass it to the template
render(request, '500.html', context)
无论如何我可以访问错误消息吗? 谢谢
【问题讨论】:
标签: django