diff --git a/actionpack/lib/action_controller/helpers.rb b/actionpack/lib/action_controller/helpers.rb index eb2b4fa7ab..e664ab2856 100644 --- a/actionpack/lib/action_controller/helpers.rb +++ b/actionpack/lib/action_controller/helpers.rb @@ -96,7 +96,7 @@ module ActionController #:nodoc: inherited_without_helper(child) begin child.helper(child.controller_name) - rescue Object + rescue NameError, LoadError # No default helper available for this controller end end diff --git a/activesupport/lib/dependencies.rb b/activesupport/lib/dependencies.rb index e5e806b65a..7f53998e7a 100644 --- a/activesupport/lib/dependencies.rb +++ b/activesupport/lib/dependencies.rb @@ -18,8 +18,10 @@ module Dependencies loaded << file_name begin require_or_load(file_name) + rescue LoadError + raise unless swallow_load_errors rescue Object => e - raise ScriptError, "#{e.message}" unless e.is_a?(LoadError) && swallow_load_errors + raise ScriptError, "#{e.message}" end end end