Improve error reporting on connection error.