pallets / quart

An async Python micro framework for building web applications.
https://quart.palletsprojects.com
MIT License
3.01k stars 164 forks source link

Exception propagation via `PROPAGATE_EXCEPTIONS` config setting does not work #383

Open jakubsvehla opened 3 days ago

jakubsvehla commented 3 days ago

When setting the PROPAGATE_EXCEPTIONS config variable to True, the ASGI app does not propagate the exceptions but instead returns the traceback as HTML. The expected behavior is to propagate the exception so that, for example, debuggers can handle it. The propagation works when setting the testing flag to True.

Below is the minimal reproducible example:

from quart import Quart

app = Quart(__name__)
app.config["PROPAGATE_EXCEPTIONS"] = True

@app.route("/")
def bug():
    1 / 0

Environment: