try-catch based test for empty generator