Will Try / Finally (without the Catch) bubble the exception?

Seth Spearman picture Seth Spearman · Nov 29, 2010 · Viewed 33.2k times · Source

I am almost positive that the answer is YES. If I use a Try Finally block but do not use a Catch block then any exceptions WILL bubble. Correct?

Any thoughts on the practice in general?

Seth

Answer

Jon Skeet picture Jon Skeet · Nov 29, 2010

Yes, it absolutely will. Assuming your finally block doesn't throw an exception, of course, in which case that will effectively "replace" the one that was originally thrown.