Improve error message when connection fails