Created by
cellfish
last modified
| void Main()
{
TestIt(true).Wait();
"**********************************".Dump();
TestIt(false).Wait();
}
async Task TestIt(bool bar)
{
try
{
if (bar)
await BarAsync(TimeSpan.FromSeconds(1));
else
await BazAsync(TimeSpan.FromSeconds(1));
}
catch (InvalidOperationException ex)
{
ex.StackTrace.Dump();
}
}
async Task FooAsync(TimeSpan t)
{
await Task.Delay(t);
throw new InvalidOperationException();
}
async Task BarAsync(TimeSpan t)
{
await FooAsync(t);
}
Task BazAsync(TimeSpan t)
{
return FooAsync(t);
}
|