public void DoRiskyThings(List<Action> tasks)
{
List<Exception> exceptions = new List<Exception>();
foreach(Action task in tasks)
{
try {task()}
catch (Exception e) {exceptions.Add(e)};
}
if (exceptions.Any())
{
//... what goes here?
}
}
I'd like to preserve all the information (especially messages and stacktraces).