This is a well-known / gotcha problem in the Java language specification, in the sense that if an exception is thrown in the finally clause (without processing it in a nested try-catch), the original exception will be lost. You will need to attach a new try-catch in order to catch the new exception and handle it there.
source share