Handle network errors more gracefully.