May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Handling exceptions is a crucial topic in parallel programming. The problem is that multiple tasks that run concurrently could raise more than one exception concurrently, and you need to understand what the actual problem is. The .NET Framework 4.0 offers the System.AggregateException class that wraps all exceptions occurred concurrently into one instance. The class then exposes, over classic properties, an InnerExceptions collection that you can iterate for checking what exceptions occurred. The following code demonstrates how you catch an AggregateException and how you iterate the instance:

Each item in InnerExceptions is ...
Read now
Unlock full access