diff --git a/lib/exception_notifiable.rb b/lib/exception_notifiable.rb index 08c42771..d5e28fce 100644 --- a/lib/exception_notifiable.rb +++ b/lib/exception_notifiable.rb @@ -46,6 +46,14 @@ def exception_data(deliverer=self) write_inheritable_attribute(:exception_data, deliverer) end end + + def exceptions_to_treat_as_404 + exceptions = [ActiveRecord::RecordNotFound, + ActionController::UnknownController, + ActionController::UnknownAction] + exceptions << ActionController::RoutingError if ActionController.const_defined?(:RoutingError) + exceptions + end end private @@ -71,7 +79,7 @@ def render_500 def rescue_action_in_public(exception) case exception - when *exceptions_to_treat_as_404 + when *self.class.exceptions_to_treat_as_404 render_404 else @@ -88,12 +96,4 @@ def rescue_action_in_public(exception) request, data) end end - - def exceptions_to_treat_as_404 - exceptions = [ActiveRecord::RecordNotFound, - ActionController::UnknownController, - ActionController::UnknownAction] - exceptions << ActionController::RoutingError if ActionController.const_defined?(:RoutingError) - exceptions - end end