before_request versus HTTP exceptions #219

Open
mitsuhiko opened this Issue Apr 18, 2011 · 2 comments

2 participants

@mitsuhiko
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.

@mitsuhiko
The Pallets Projects member

There is an experimental branch for this now.

@mathiasbc

This is replicable with:

from flask import Flask
from werkzeug.exceptions import HTTPException

app = Flask(__name__)

@app.before_request
def f():
    raise HTTPException("This is not propagated as an Exception")

@app.route('/')
def test():
    return 'This is a view'

if __name__ == '__main__':
    app.run()

Where is flask filtering/swallowing HTTPExceptions ?

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