Browse files

don't let a single message error stop the whole mail loop

  • Loading branch information...
1 parent bcc2302 commit 443cbf71c2c84bb1da0054f1ab7efc7b24d60ab7 @pbrisbin committed Feb 29, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/basil/email.rb
View
8 lib/basil/email.rb
@@ -32,8 +32,12 @@ def check_email(interval, &block)
Plugin.email_strategies.each do |strategy|
if strategy.respond_to?(:create_message)
- message = strategy.create_message(mail)
- yield(strategy, message) if message
+ begin
+ message = strategy.create_message(mail)
+ yield(strategy, message) if message
+ rescue Exception => ex
+ $stderr.puts "Error processing mail #{mail['Subject']}, #{ex}"
+ end
end
end

0 comments on commit 443cbf7

Please sign in to comment.