# Handling parallel exceptions in dotnet

I’m executing several tasks in parallel, where more than one throw exceptions. I want to handle all the exceptions, which basically means catching them all and being able to, at least, rethrowing them with all the info they carry.

So, here it is how

var runnersTasks = new List<Task>();// list to keep the tasks created
Task compositeTask = null; // task consisting in waiting for all the tasks to finish in parallel
try
{
// run all the tasks and keep them in the list

// just wait for them all to finish, and keep the reference
}
catch (Exception) // here if you actually catch the exception, you'll find it's only the first one thrown
{
//usually just throw back the full AggregateException, rather than just the first exception catched here