Try-catch in an iterator - C#