Improve logging on web socket connection closed
Author: nirben82Created Apr 17, 2025Updated Apr 17, 2025
Labelsbug
Describe the bug When using web sockets and a connection is closed, an error is logged which can be confusing - https://github.com/mesop-dev/mesop/blob/be1391805006c7bf71deeeba0eb7a2159566f395/mesop/server/server.py#L355
Expected behavior When simple-socket closes the connection, it raises a ConnectionClosed exception, which does not indicate an error. I think it would be useful to catch this specific exception and log at info level that the connection was closed and the reason code.
Source: mesop-dev/mesop