This repository has been archived by the owner on Mar 9, 2021. It is now read-only.
[2.6.2] Canceled tasks should throw TaskCanceledException instead of InvalidOperationException #427
Labels
Milestone
Currently, when waiting on a task and the task is canceled "InvalidOperationException" is thrown instead of "TaskCanceledException" as in .NET Framework. Since it is possible that the task itself throws "InvalidOperationException" during its execution the caller of the task cannot distinguish between the two cases based on the exception catch. Therefore, it would be better to throw "TaskCanceledException" to let the caller know that the task was canceled.
The text was updated successfully, but these errors were encountered: