From 18ac3d44b843b0f28fa748146eec78da0561f195 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 3 Feb 2011 12:24:30 -0500 Subject: [PATCH] Handle the case where an account's domain has already been deleted (and thus the account is gone when we try to delete it). --- bin/mailshears | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/mailshears b/bin/mailshears index 9f91362..5a156f9 100755 --- a/bin/mailshears +++ b/bin/mailshears @@ -116,8 +116,14 @@ Plugin.includers.each do |plugin_class| end leftover_accounts.each do |account| - plugin.delete_account(account) - puts "Removed: #{account} (#{plugin.describe_account(account)})" + begin + plugin.delete_account(account) + puts "Removed: #{account} (#{plugin.describe_account(account)})" + rescue NonexistentAccountError => e + # This usually happens after an account's domain is deleted. + # When we try to delete the account, it's already gone. + puts "Gone: #{account} (#{plugin.describe_account(account)})" + end end end -- 2.44.2