Handle network-related exceptions when doing a POST.

Bug: 72832

Change-Id: I6abb3c7348c2c4241c9d3a26c738873157295097