more robustly handle connection/handshake errors
better error msg for connection failure