Handle network errors gracefully