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
I have an issue in my code that means the server cannot start. Instead of seeing the error in the logs and have the server exit, Uvicorn/Connexion is swallowing the exception and erroneously displaying "ASGI 'lifespan' protocol appears unsupported." instead. It does this whether or not I specify lifespan= in the init call.
Expected behaviour
The server should exit with an error message and the exception text if it fails to start.
Actual behaviour
Uvicorn appears to still be running even though the webserver failed to start/exited
Steps to reproduce
In my case the error was in a call to a decorator on an API endpoint handler, probably easy to reproduce something similar.
is executed. Even then, the exception message would be swallowed. It seems like there should be an exception handler further up the stack catching the exception, printing the message and setting self.startup_failed, but I don't really know.
Output of the commands:
python --version Python 3.11.3
pip show connexion | grep "^Version\:" Version: 3.0.0a5
The text was updated successfully, but these errors were encountered:
Description
I have an issue in my code that means the server cannot start. Instead of seeing the error in the logs and have the server exit, Uvicorn/Connexion is swallowing the exception and erroneously displaying "ASGI 'lifespan' protocol appears unsupported." instead. It does this whether or not I specify
lifespan=
in the init call.Expected behaviour
The server should exit with an error message and the exception text if it fails to start.
Actual behaviour
Uvicorn appears to still be running even though the webserver failed to start/exited
Steps to reproduce
In my case the error was in a call to a decorator on an API endpoint handler, probably easy to reproduce something similar.
This endpoint is referenced in the swagger spec.
Additional info:
The runtime error I get in my code is:
TypeError("fb_api() got an unexpected keyword argument 'required_permissions'")
But the logging output is:
100% a simple bug in my code. I can see this by placing a breakpoint in the exception handler uvicorn.lifespan.on.py:
Ideally this block of code would be executed:
But instead
is executed. Even then, the exception message would be swallowed. It seems like there should be an exception handler further up the stack catching the exception, printing the message and setting
self.startup_failed
, but I don't really know.Output of the commands:
python --version
Python 3.11.3pip show connexion | grep "^Version\:"
Version: 3.0.0a5The text was updated successfully, but these errors were encountered: