quart icon indicating copy to clipboard operation
quart copied to clipboard

Allow to pass errors through in `Quart.run` as in `Flask.run` (via `passthrough_errors=True`)

Open jakubsvehla opened this issue 1 year ago • 0 comments

It would be great if Quart.run was able to pass through errors at the server level and let the server crash. This option would be super useful in debugging and improve the developer experience since a lot of debuggers (e.g., in VS Code or PyCharm) allow debugging unhandled exceptions automatically without setting breakpoints. Currently, all exceptions are handled at the server level so they won't bubble up to the debugger.

Flask.run allows doing that when setting passthrough_errors=True (together with use_debugger=False), which is further passed to werkzeug.serving.run_simple (https://werkzeug.palletsprojects.com/en/3.0.x/serving/#werkzeug.serving.run_simple).

Since Quart is using Hypercorn it would probably require changes to both Quart and Hypercorn.

Quart itself allows errors to be passed through on the app level via the PROPAGATE_EXCEPTIONS config, but not on the server level.

Thanks!

jakubsvehla avatar Sep 07 '24 14:09 jakubsvehla