Handle websocket errors in a less exception spammy / user friendly way
What Happened?
If you connect to the baserow websocket endpoint with an invalid an unhandled 500 error will occur. Additionally if the server tries to send results back to the websocket client and it can't because they have disconnected etc further errors will be raised spamming any exception monitoring software with suprious errors.
Expected result
An error should not be raised but instead returned. We could perhaps wrap the inner call in baserow.ws.auth.JWTTokenAuthMiddleware.__call__
with custom error handling code looking for a ValueError("No route found for path %r." % path)
raised by django channels. Additionally this error handler could look for ConnectionClosedOK
, ConnectionClosedError
, ConnectionRefusedError
and ConnectionResetError
and ignore those from any exception logging.
Steps to reproduce
Connect to the websocket endpoint using a path like socket.io
. Or connect and disconnect whilst the server is responding.
Sentry issues
f64baa474a774493b085dfd8b32435e5/?project=5203159
Priority/Severity
-
Low (anything else e.g., typos, missing icons, layout issues, etc.)