With parallel foreach loops, developers can wrap the loop in a try...catch statement. Care needs to be taken, however, because the Parallel.ForEach will throw an AggregatedException, which has the exceptions it encounters over several threads rolled into one.