Do not show AsyncConverter.AsyncWait error on finished tasks
DawidIzydor opened this issue · 0 comments
DawidIzydor commented
In a scenario, where one has multiple Tasks and wants to put some logic to run after any task is finished (ie. progress reporting) Exceptional shows unnecesary error.
Example code
List<Task<string>> tasks = CreateSomeTasks();
while(tasks.Any())
{
var finished = await Task.WhenAny(tasks);
tasks.Remove(finished);
DoSomethingWith(finished.Result);
}
On the last lane there will be error that the code synchronizacly waits for async operation, when the task is already finished so no waiting occur.
The easiest way other than to disable once, would be to have a smart surpresion - ie. if "finished" key word is used in the name it defaults to Warning instead of Error and the severity could be separatly configured