diff --git a/solara/server/starlette.py b/solara/server/starlette.py index db0297180..971d5f0b9 100644 --- a/solara/server/starlette.py +++ b/solara/server/starlette.py @@ -228,7 +228,10 @@ async def run(): await thread_return finally: if settings.main.experimental_performance: - ws_wrapper.task.cancel() + try: + ws_wrapper.task.cancel() + except: # noqa + logger.exception("error cancelling websocket task") try: await ws.close() except: # noqa