From 42630b9b76805c76abdd4a31063117b17fb405b4 Mon Sep 17 00:00:00 2001 From: alto Date: Thu, 14 Oct 2010 17:02:50 +0200 Subject: [PATCH] include the patch provided by Lawrence Pit (see https://rails.lighthouseapp.com/projects/8995-rails-plugins/tickets/87) --- lib/exception_notifier.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/exception_notifier.rb b/lib/exception_notifier.rb index d12a6af6..b780829e 100644 --- a/lib/exception_notifier.rb +++ b/lib/exception_notifier.rb @@ -4,21 +4,21 @@ class ExceptionNotifier def self.default_ignore_exceptions [].tap do |exceptions| - exceptions << ActiveRecord::RecordNotFound if defined? ActiveRecord - exceptions << AbstractController::ActionNotFound if defined? AbstractController - exceptions << ActionController::RoutingError if defined? ActionController + exceptions << ::ActiveRecord::RecordNotFound if defined?(::ActiveRecord::RecordNotFound) + exceptions << ::AbstractController::ActionNotFound if defined?(::AbstractController::ActionNotFound) + exceptions << ::ActionController::RoutingError if defined?(::ActionController::RoutingError) end end def initialize(app, options = {}) @app, @options = app, options - @options[:ignore_exceptions] ||= self.class.default_ignore_exceptions end def call(env) @app.call(env) rescue Exception => exception options = (env['exception_notifier.options'] ||= {}) + @options[:ignore_exceptions] ||= self.class.default_ignore_exceptions options.reverse_merge!(@options) unless Array.wrap(options[:ignore_exceptions]).include?(exception.class)