Raise LoadErrors separately

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 be80d460
...@@ -96,7 +96,7 @@ def inherited(child) ...@@ -96,7 +96,7 @@ def inherited(child)
inherited_without_helper(child) inherited_without_helper(child)
begin begin
child.helper(child.controller_name) child.helper(child.controller_name)
rescue Object rescue NameError, LoadError
# No default helper available for this controller # No default helper available for this controller
end end
end end
......
...@@ -18,8 +18,10 @@ def depend_on(file_name, swallow_load_errors = false) ...@@ -18,8 +18,10 @@ def depend_on(file_name, swallow_load_errors = false)
loaded << file_name loaded << file_name
begin begin
require_or_load(file_name) require_or_load(file_name)
rescue LoadError
raise unless swallow_load_errors
rescue Object => e rescue Object => e
raise ScriptError, "#{e.message}" unless e.is_a?(LoadError) && swallow_load_errors raise ScriptError, "#{e.message}"
end end
end end
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册