using System;
using System.Reactive.Linq;
using System.Reactive;
using System.Threading;
public class Program
{
public static void Main()
Observable
.Range(0, 3)
.Select((iteration) =>
try
if (iteration == 2)
throw new Exception();
}
return "Success!";
catch(Exception ex)
Console.WriteLine("Caught!");
return "Exception!";
})
.Do((message) =>
Console.WriteLine("After: " + message);
.RunAsync(new CancellationToken())
.Wait();