Commit df46d704 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Log email delivery errors.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3356 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent a0364deb
......@@ -284,7 +284,21 @@ class Mailer < ActionMailer::Base
if @references_objects
mail.references = @references_objects.collect {|o| self.class.message_id_for(o)}
end
super(mail)
# Log errors when raise_delivery_errors is set to false, Rails does not
raise_errors = self.class.raise_delivery_errors
self.class.raise_delivery_errors = true
begin
return super(mail)
rescue Exception => e
if raise_errors
raise e
elsif mylogger
mylogger.error "The following error occured while sending email notification: \"#{e.message}\". Check your configuration in config/email.yml."
end
ensure
self.class.raise_delivery_errors = raise_errors
end
end
# Sends reminders to issue assignees
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment