This is a very good question, and it is rather complicated. Skip this step by step:
try { throw new Exception("From Try"); } catch { throw new Exception("From Catch"); }
In the above code, an Exception ("From Try") is thrown and caught by a catch clause (pretty simple so far). The catch clause throws an exception from it, which we usually expect (because the catch is nested in a larger try-catch block) to be caught immediately, but ...
finally { throw new Exception("From Finally"); }
The finally clause, which is guaranteed to (try) to execute, comes first, and throws an exception from its own, overwriting the exception ("From Catch") that was thrown earlier.
"The usual use of the catch and, finally, together is to receive and use resources in the try block, exceptional circumstances in the catch to block and free resources in the finally block" - MSDN Article
Following this logical principle, we should try to refrain from writing code in our catch and, finally, blocks that are not prone to errors. If you are concerned about a situation like the one you presented, I recommend that you log exceptions and their related information to an external file that you can reference debugging.
source share