Instead of raise an error, use status code to close the connection with the server is something received from the endpoint is wrong. The errors than the user can perform should still raise websocket errors.