Proactively handle network connection error.

Change-Id: Ie378e5ffa67f8921a340eba7f85adda7866d5adc