Skip to content

Commit f8507d6

Browse files
committed
Clean up explanation of the single-layer AggregateException guarantee
1 parent c44269b commit f8507d6

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/Documentation/Content/AsynchronousServices.aml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,17 @@
250250
<para>
251251
This library additionally ensures that exceptions thrown by asynchronous operations are not wrapped in
252252
multiple layers of <codeEntityReference>T:System.AggregateException</codeEntityReference>. In other words,
253-
an <codeEntityReference>T:System.AggregateException</codeEntityReference> thrown during the asynchronous
253+
an <codeEntityReference>T:System.ArgumentException</codeEntityReference> thrown during the asynchronous
254254
execution of a task will result in the
255255
<codeEntityReference>P:System.Threading.Tasks.Task.Exception</codeEntityReference> property returning an
256-
<codeEntityReference>T:System.AggregateException</codeEntityReference> with exactly one inner exception,
257-
which is the original <codeEntityReference>T:System.ArgumentException</codeEntityReference>. This
258-
guarantee simplifies the use of the API is languages that support <token>AsyncAwait</token>, since those
259-
operators automatically unwrap the first layer of
260-
<codeEntityReference>T:System.AggregateException</codeEntityReference>.
256+
<codeEntityReference>T:System.AggregateException</codeEntityReference>, and that exception will not
257+
contain an nested instances of <codeEntityReference>T:System.AggregateException</codeEntityReference> in
258+
the <codeEntityReference>P:System.AggregateException.InnerExceptions</codeEntityReference> collection. In
259+
most cases, the <codeEntityReference>T:System.AggregateException</codeEntityReference> wraps exactly one
260+
inner exception, which is the original
261+
<codeEntityReference>T:System.ArgumentException</codeEntityReference>. This guarantee simplifies the use
262+
of the API is languages that support <token>AsyncAwait</token>, since those operators automatically unwrap
263+
the first layer of <codeEntityReference>T:System.AggregateException</codeEntityReference>.
261264
</para>
262265
<code language="cs" region="ExceptionDuringTaskExecution" source="..\Samples\CSharpCodeSamples\AsynchronousExceptionsExamples.cs"/>
263266
<code language="vb" region="ExceptionDuringTaskExecution" source="..\Samples\VBCodeSamples\AsynchronousExceptionsExamples.vb"/>

0 commit comments

Comments
 (0)