Why is try {…} finally {…} good; try {…} catch{} bad?

The big difference is that try...catch will swallow the exception, hiding the fact that an error occurred. try..finally will run your cleanup code and then the exception will keep going, to be handled by something that knows what to do with it.

Leave a Comment