Add test coverage to cover try-catch block