Browse files

Added note on teardown in debug mode. Fixes #661

  • Loading branch information...
1 parent 3b393f8 commit 6ab569b0e3791cf04db7c333bbf5b78d33255dad @mitsuhiko mitsuhiko committed Jan 27, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 flask/
@@ -1250,6 +1250,13 @@ def teardown_request(self, f):
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

0 comments on commit 6ab569b

Please sign in to comment.