Add network error handling

Closes https://github.com/CocoaPods/cocoapods-trunk/issues/18