我目前在Rails 2.3.5上,并且尽量在我的应用程序中尝试使用rescue_from异常。在rails中有什么好的最佳实践来处理异常?
我的ApplicationController救援看现在这个样子:
rescue_from Acl9::AccessDenied, :with => :access_denied
rescue_from Exceptions::NotPartOfGroup, :with => :not_part_of_group
rescue_from Exceptions::SomethingWentWrong, :with => :something_went_wrong
rescue_from ActiveRecord::RecordNotFound, :with => :something_went_wrong
rescue_from ActionController::UnknownAction, :with => :something_went_wrong
rescue_from ActionController::UnknownController, :with => :something_went_wrong
rescue_from ActionController::RoutingError, :with => :something_went_wrong
我也希望能够赶上上面没有列出任何异常。有建议的方式,我应该写我的救援?
感谢