using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
foreach (var i in GetAll()) {
Console.WriteLine(i);
}
static IEnumerable<int> GetAll() {
try {
return GetAllImpl();
} catch (Exception) {
Console.WriteLine("GetAllImpl threw");
return null;
static IEnumerable<int> GetAllImpl() {
yield return 1;
throw new NotImplementedException();