Consider a situation where I have three (or more) ways of performing a calculation, each of which can fail with an exception. In order to attempt each calculation until we f
As far as possible, don't use exceptions for control flow or unexceptional circumstances.
But to answer your question directly (assuming all the exception-types are the same):
Func[] calcs = { calc1, calc2, calc3 };
foreach(var calc in calcs)
{
try { return calc(); }
catch (CalcException){ }
}
throw new NoCalcsWorkedException();