aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/CHANGELOG2
-rw-r--r--activesupport/lib/active_support/dependencies.rb4
-rw-r--r--activesupport/test/core_ext/exception_test.rb2
3 files changed, 5 insertions, 3 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG
index bcf2860c53..1d15c27fef 100644
--- a/activesupport/CHANGELOG
+++ b/activesupport/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Tighten rescue clauses. #5985 [james@grayproductions.net]
+
* Inflections: don't singularize -ies plurals. [foamdino@gmail.com, Mark Van Holstyn]
* Update Initializer to use load_once_paths to avoid plugin reloading. References #5852. [Nicholas Seckar]
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index ca418fe500..7a74884dc7 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -341,14 +341,14 @@ end
class Object #:nodoc:
def load(file, *extras)
super(file, *extras)
- rescue Object => exception
+ rescue Exception => exception # errors from loading file
exception.blame_file! file
raise
end
def require(file, *extras)
super(file, *extras)
- rescue Object => exception
+ rescue Exception => exception # errors from required file
exception.blame_file! file
raise
end
diff --git a/activesupport/test/core_ext/exception_test.rb b/activesupport/test/core_ext/exception_test.rb
index 952ac04e2e..b1ea564a0c 100644
--- a/activesupport/test/core_ext/exception_test.rb
+++ b/activesupport/test/core_ext/exception_test.rb
@@ -4,7 +4,7 @@ class ExceptionExtTests < Test::Unit::TestCase
def get_exception(cls = RuntimeError, msg = nil, trace = nil)
begin raise cls, msg, (trace || caller)
- rescue Object => e
+ rescue Exception => e # passed Exception
return e
end
end