|
250 | 250 | <para> |
251 | 251 | This library additionally ensures that exceptions thrown by asynchronous operations are not wrapped in |
252 | 252 | 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 |
254 | 254 | execution of a task will result in the |
255 | 255 | <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>. |
261 | 264 | </para> |
262 | 265 | <code language="cs" region="ExceptionDuringTaskExecution" source="..\Samples\CSharpCodeSamples\AsynchronousExceptionsExamples.cs"/> |
263 | 266 | <code language="vb" region="ExceptionDuringTaskExecution" source="..\Samples\VBCodeSamples\AsynchronousExceptionsExamples.vb"/> |
|
0 commit comments