Better client-server connection error handling