From 70ae965de187244d5fde7dfff9c1c274fbba581f Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 12 Nov 2013 14:27:08 +0000 Subject: Add a dummy exception notification address for testing ActionMailer now checks for a 'to' address on sending mail, so supply one so that we can check exception notification mail sending. Also check that we have one before trying to call the exception notification code. --- app/controllers/application_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/controllers/application_controller.rb') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index cbdffc441..161a82b26 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -138,7 +138,9 @@ class ApplicationController < ActionController::Base backtrace = Rails.backtrace_cleaner.clean(exception.backtrace, :silent) message << " " << backtrace.join("\n ") Rails.logger.fatal("#{message}\n\n") - ExceptionNotifier::Notifier.exception_notification(request.env, exception).deliver + if !AlaveteliConfiguration.exception_notifications_from.blank? && !AlaveteliConfiguration.exception_notifications_to.blank? + ExceptionNotifier::Notifier.exception_notification(request.env, exception).deliver + end @status = 500 end respond_to do |format| -- cgit v1.2.3