Catching exception with try-catch-finally