Skip to content

Do not show AsyncConverter.AsyncWait error on finished tasks #116

@DawidIzydor

Description

@DawidIzydor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions