public async Task WhatThisAllowsUsTodo()
{
Func<Func<Task>, Task> exceptionHandler = async next =>
{
try
{
await next();
}
catch (Exception)
{
Console.WriteLine("We caught an exception for you.");
}
};
var actions = new List<Func<Func<Task>, Task>>
{
Retrier,
MethodAsync1,
MethodAsync2,
MethodAsync3,
//exceptionHandler,
EvilMethod
};
await Invoke(actions);
}