chore: added throwing task exception when faulted on WaitForTaskYield

This commit is contained in:
2026-04-06 15:01:05 +03:00
parent 3893a1d249
commit 497eedab72

View File

@@ -14,7 +14,7 @@ public class WaitForTaskYield(Task task, TaskCompletionStatus completionStatus =
if (task.IsCanceled)
throw new("Task has been canceled.");
if (task.IsFaulted)
throw new("Task has faulted.");
throw task.Exception ?? new("Task has faulted.");
return task.IsCompletedSuccessfully;
case TaskCompletionStatus.Failed: