Improved error reporting when unable to connect