Catch networking errors gracefully