So I was wondering about the behaviour of a nested try-catch-finally
blocks.
What I mean is, what if inside the first finally
block, we have another try-catch-finally
blocks and a exception happens in the inner finally
block??
Is the exception going to be propagated? And is it going to be caught somewhere?
Where should I catch the exception? In the inner finally
block or if it's propagated should I catch it from the upper code?
Example:
static bool Func()
{
try
{}
catch
{}
finally
{
try
{}
catch
{}
finally
{
throw new ApplicationException();
}
}
}