Improve log and retry connections if exception

Change-Id: Id9ad5c1b5c1d1e0ac18a33e6b83bf6697a0f9eb8