]> gitweb.michael.orlitzky.com - mailshears.git/commitdiff
Add the domain/account name to NonexistentDomain/Account errors.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 16 Jul 2012 14:25:12 +0000 (10:25 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 16 Jul 2012 14:25:12 +0000 (10:25 -0400)
lib/mailshears/plugins/dovecot_mailstore.rb

index 44701bbd5c21c92c6a53cea72c501347414c9e54..cf4711c31c20b941ebc26c797163aa7017859e07 100644 (file)
@@ -21,7 +21,7 @@ class DovecotMailstore < Mailstore
       domain_path = get_domain_path(domain)
       return domain_path
     rescue NonexistentDomainError => e
       domain_path = get_domain_path(domain)
       return domain_path
     rescue NonexistentDomainError => e
-      return "Doesn't Exist"
+      return "Doesn't exist: #{e.to_s}"
     end
   end
 
     end
   end
 
@@ -30,7 +30,7 @@ class DovecotMailstore < Mailstore
       account_path = get_account_path(account)
       return account_path
     rescue NonexistentAccountError => e
       account_path = get_account_path(account)
       return account_path
     rescue NonexistentAccountError => e
-      return "Doesn't Exist"
+      return "Doesn't exist: #{e.to_s}"
     end
   end
 
     end
   end
 
@@ -81,7 +81,7 @@ class DovecotMailstore < Mailstore
         usernames.each do |username|
           accounts << "#{username}@#{domain}"
         end
         usernames.each do |username|
           accounts << "#{username}@#{domain}"
         end
-      rescue NonexistentDomainError => e
+      rescue NonexistentDomainError
         # Party hard.
       end
     end
         # Party hard.
       end
     end
@@ -99,7 +99,7 @@ class DovecotMailstore < Mailstore
     if File.directory?(domain_path)
       return domain_path
     else
     if File.directory?(domain_path)
       return domain_path
     else
-      raise NonexistentDomainError
+      raise NonexistentDomainError.new(domain)
     end
   end
 
     end
   end
 
@@ -118,7 +118,7 @@ class DovecotMailstore < Mailstore
     begin
       domain_path = get_domain_path(domain_part)
     rescue NonexistentDomainError
     begin
       domain_path = get_domain_path(domain_part)
     rescue NonexistentDomainError
-      raise NonexistentAccountError
+      raise NonexistentAccountError.new(account)
     end
 
     account_path = File.join(domain_path, user_part)
     end
 
     account_path = File.join(domain_path, user_part)
@@ -126,7 +126,7 @@ class DovecotMailstore < Mailstore
     if File.directory?(account_path)
       return account_path
     else
     if File.directory?(account_path)
       return account_path
     else
-      raise NonexistentAccountError
+      raise NonexistentAccountError(account)
     end
   end
 
     end
   end