About This eBook by Bart De Smet

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Unwrapping AggregateExceptions

What about tasks that have multiple exceptions? As you might recall from Chapter 30, you can use Task objects for parallel computing where multiple units of work can fail. A good example of this behavior is the use of the Parallel class to run multiple loop iterations in parallel. To capture all possible exception states, the AggregateException type was introduced in .NET 4.0. Handling such an exception can be quite tedious, though, because regular catch blocks cannot be used to inspect any of the object’s inner exceptions. Instead, a Handle method has to be called, specifying a handler method through a delegate.

Nowadays, tasks are increasingly commonly used as futures that represent the eventual completion of ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required