Permalink
Browse files

Always trap proxy exceptions

  • Loading branch information...
1 parent ff2e844 commit f1537a9d7a1e5ab53e38166a2a8fd7bad9278c18 @mitsuhiko mitsuhiko committed Jan 21, 2013
Showing with 8 additions and 2 deletions.
  1. +2 −0 CHANGES
  2. +6 −2 flask/app.py
View
@@ -43,6 +43,8 @@ Release date to be decided.
context which makes them available in imported templates. One has to be
very careful with those though because usage outside of macros might
cause caching.
+- Flask will no longer invoke the wrong error handlers if a proxy
+ exception is passed through.
Version 0.9
-----------
View
@@ -1327,8 +1327,12 @@ def handle_user_exception(self, e):
# ensure not to trash sys.exc_info() at that point in case someone
# wants the traceback preserved in handle_http_exception. Of course
# we cannot prevent users from trashing it themselves in a custom
- # trap_http_exception method so that's their fault then.
- if isinstance(e, HTTPException) and not self.trap_http_exception(e):
+ # trap_http_exception method so that's their fault then. Proxy
+ # exceptions generally must always be trapped (filtered out by
+ # e.code == None)
+ if isinstance(e, HTTPException) \
+ and e.code is not None \
+ and not self.trap_http_exception(e):
return self.handle_http_exception(e)
blueprint_handlers = ()

0 comments on commit f1537a9

Please sign in to comment.