Added note on teardown in debug mode. Fixes #661

This commit is contained in:
Armin Ronacher 2013-01-27 00:56:01 +00:00
parent 3b393f89f6
commit 6ab569b0e3

View file

@ -1250,6 +1250,13 @@ class Flask(_PackageBoundObject):
When a teardown function was called because of a exception it will
be passed an error object.
.. admonition:: Debug Note
In debug mode Flask will not tear down a request on an exception
immediately. Instead if will keep it alive so that the interactive
debugger can still access it. This behavior can be controlled
by the ``PRESERVE_CONTEXT_ON_EXCEPTION`` configuration variable.
"""
self.teardown_request_funcs.setdefault(None, []).append(f)
return f