You don't want to use exception handling to exit the task. You can use 'abort' or 'exit'.
So your code would do something like this:
billing_infos.each do |candidate|
unless keeper.nil?
if keeper.has_trevance_info? && candidate.has_trevance_info?
puts "Another record already has that info! Manually compare BillingInfo ##{keeper.id}"
exit
end
else
keeper = candidate
end
end
Or:
billing_infos.each do |candidate|
unless keeper.nil?
abort("Another record already has that info! Manually compare BillingInfo ##{keeper.id}") if keeper.has_trevance_info? && candidate.has_trevance_info?
else
keeper = candidate
end
end