Refactoring try-catch Exception to 1.8 style