mirror of
https://github.com/github/rails.git
synced 2026-02-11 06:35:10 -05:00
Tighten rescue clauses. Closes #5985.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4885 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user