@@ -60,17 +60,31 @@ extension Task {
60
60
/// If the awaited on task gets cancelled externally the `get()` will throw
61
61
/// a cancellation error.
62
62
///
63
- /// If the task gets cancelled internally --
64
- /// for example, by checking for cancellation
65
- /// and throwing a specific error, or by calling `checkCancellation()`,
66
- /// then the error thrown by the task is rethrown here.
63
+ /// If the task gets cancelled internally, e.g. by checking for cancellation
64
+ /// and throwing a specific error or using `checkCancellation` the error
65
+ /// thrown out of the task will be re-thrown here.
67
66
public var value : Success {
68
67
get async throws {
69
68
return try await _taskFutureGetThrowing ( _task)
70
69
}
71
70
}
72
71
73
- /// Wait for the task to complete, returning its result.
72
+ /// Wait for the task to complete, returning (or throwing) its result.
73
+ ///
74
+ /// ### Priority
75
+ /// If the task has not completed yet, its priority will be elevated to the
76
+ /// priority of the current task. Note that this may not be as effective as
77
+ /// creating the task with the "right" priority to in the first place.
78
+ ///
79
+ /// ### Cancellation
80
+ /// If the awaited on task gets cancelled externally the `get()` will throw
81
+ /// a cancellation error.
82
+ ///
83
+ /// If the task gets cancelled internally, e.g. by checking for cancellation
84
+ /// and throwing a specific error or using `checkCancellation` the error
85
+ /// thrown out of the task will be re-thrown here.
86
+
87
+ /// Wait for the task to complete, returning its `Result`.
74
88
///
75
89
/// ### Priority
76
90
/// If the task has not completed yet, its priority will be elevated to the
@@ -81,10 +95,9 @@ extension Task {
81
95
/// If the awaited on task gets cancelled externally the `get()` will throw
82
96
/// a cancellation error.
83
97
///
84
- /// If the task gets cancelled internally --
85
- /// for example, by checking for cancellation
86
- /// and throwing a specific error, or by calling `checkCancellation()`,
87
- /// then the error thrown by the task is returned here.
98
+ /// If the task gets cancelled internally, e.g. by checking for cancellation
99
+ /// and throwing a specific error or using `checkCancellation` the error
100
+ /// thrown out of the task will be re-thrown here.
88
101
public var result : Result < Success , Failure > {
89
102
get async {
90
103
do {
0 commit comments