Handle handshake errors in a comprehensive manner