如果找到主键,此代码将打印 'a' 'b' 'e'。如果不是,则仅打印“a”。什么会导致异常被吞下?
def foo(request, e_pk):
try:
pprint('a')
facet = models.EntryFacet.objects.get(pk=e_pk)
pprint('b')
except models.EntryFacet.DoesNotExist:
pprint('c ' + sys.exc_info()[0])
except ObjectDoesNotExist:
pprint('d ' + sys.exc_info()[0])
pprint('e')
return render_to_response(...)
环境:django 1.3,Linux。settings.py 有 DEBUG = True TEMPLATE_DEBUG = DEBUG