before_request versus HTTP exceptions #219

mitsuhiko opened this Issue Apr 18, 2011 · 2 comments

2 participants

The Pallets Projects member

Right now before_request cannot emit HTTP exceptions. This should be improved by allowing a certain useful subset of exception functionality there.

The Pallets Projects member

There is an experimental branch for this now.


This is replicable with:

from flask import Flask
from werkzeug.exceptions import HTTPException

app = Flask(__name__)

def f():
    raise HTTPException("This is not propagated as an Exception")

def test():
    return 'This is a view'

if __name__ == '__main__':

Where is flask filtering/swallowing HTTPExceptions ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment