better error message on handshake failure