From 74a612c4a15f3094e478aa79eb63b27efec8358a Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 2 May 2005 15:03:13 +0000 Subject: Added that delivery errors are caught in a way so the mail is still returned whether the delivery was successful or not git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1272 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionmailer/lib/action_mailer/base.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'actionmailer/lib') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 3b9d25723b..faade19e9e 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -100,14 +100,8 @@ module ActionMailer #:nodoc: class << self def method_missing(method_symbol, *parameters)#:nodoc: case method_symbol.id2name - when /^create_([_a-z]\w*)/ - create_from_action($1, *parameters) - when /^deliver_([_a-z]\w*)/ - begin - deliver(send("create_" + $1, *parameters)) - rescue Object => e - raise e if raise_delivery_errors - end + when /^create_([_a-z]\w*)/ then create_from_action($1, *parameters) + when /^deliver_([_a-z]\w*)/ then deliver(send("create_" + $1, *parameters)) end end @@ -134,7 +128,13 @@ module ActionMailer #:nodoc: def deliver(mail) #:nodoc: logger.info "Sent mail:\n #{mail.encoded}" unless logger.nil? - send("perform_delivery_#{delivery_method}", mail) if perform_deliveries + + begin + send("perform_delivery_#{delivery_method}", mail) if perform_deliveries + rescue Object => e + raise e if raise_delivery_errors + end + return mail end -- cgit v1.2.3