Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def exceptions_to_treat_as_404
- exceptions = [ActiveRecord::RecordNotFound,
- ActionController::UnknownController,
- ActionController::UnknownAction]
- exceptions << ActionController::RoutingError if ActionController.const_defined?(:RoutingError)
- exceptions
- end
- def rescue_action_in_public(exception)
- case exception
- when *self.class.exceptions_to_treat_as_404
- render_404
- else
- # render_500
- # dont render_500, do it in application.rb
- deliverer = self.class.exception_data
- data = case deliverer
- when nil then {}
- when Symbol then send(deliverer)
- when Proc then deliverer.call(self)
- end
- ExceptionNotifier.deliver_exception_notification(exception, self,
- request, data)
- end
- end
Add Comment
Please, Sign In to add comment