Open WalterGoy opened 3 weeks ago
Tagging subscribers to this area: @dotnet/area-system-threading-tasks
The exception is supposed to be thrown, and wrapped in AggregateException
and caught in the catch block in the code example.
When you run the code, is the output of the program significantly different form the example output given in the code snippet?
Type of issue
Code doesn't work
Description
When this example is run, an this exception --- System.OperationCanceledException: 'The operation was canceled.' --- is thrown. When this line --- //token.ThrowIfCancellationRequested(); --- is commented out, the example runs.
Page URL
https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.taskstatus?view=net-8.0#system-threading-tasks-taskstatus-created
Content source URL
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Threading.Tasks/TaskStatus.xml
Document Version Independent Id
8a50e248-3e54-65d8-e726-48b23a07265e
Article author
@dotnet-bot