You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ FLASK_APP=a.py flask run --lazy-loading
$ curl http://127.0.0.1:5000
[...]
Traceback (most recent call last):
File "[...]/lib/python3.9/site-packages/flask/cli.py", line 356, in __call__
self._flush_bg_loading_exception()
File "[...]/lib/python3.9/site-packages/flask/cli.py", line 344, in _flush_bg_loading_exception
raise exc_info
TypeError: exceptions must derive from BaseException
I expected something about a RuntimeError. raise exc_info[1] here worked for me
Yes thank you for reporting this, glad I am not the only one, thought I was going crazy!
This happens for any exception from anywhere in the project, but only sometimes, seemingly at random. It gets replaced with this TypeError instead of the expected exception.
I have only observed this while running with the flask run dev server, not in production.
It seems to happen right after server autoreload on code update. It seems to happen on the first load of the page after server reload. When reloading the page again, the problem always goes away, and the expected exception is raised.
I expected something about a RuntimeError.
raise exc_info[1]
here worked for meflask/src/flask/cli.py
Line 342 in 7161776
Environment:
The text was updated successfully, but these errors were encountered: