From a548792aa0beef4330a3d47eb75dd2fe741013bc Mon Sep 17 00:00:00 2001 From: Andrew Kreiling Date: Sun, 3 Mar 2013 07:50:59 -0600 Subject: Don't blindly call blame_file! on exceptions in ActiveSupport::Dependencies::Loadable It is possible under some environments to receive an Exception that is not extended with Blamable (e.g. JRuby). ActiveSupport::Dependencies::Loadable#load_dependency blindly call blame_file! on the exception which throws it's own NoMethodError exception and hides the original Exception. This commit fixes #9521 --- .../test/dependencies/raises_exception_without_blame_file.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 activesupport/test/dependencies/raises_exception_without_blame_file.rb (limited to 'activesupport/test/dependencies') diff --git a/activesupport/test/dependencies/raises_exception_without_blame_file.rb b/activesupport/test/dependencies/raises_exception_without_blame_file.rb new file mode 100644 index 0000000000..4b2da6ff30 --- /dev/null +++ b/activesupport/test/dependencies/raises_exception_without_blame_file.rb @@ -0,0 +1,5 @@ +exception = Exception.new('I am not blamable!') +class << exception + undef_method(:blame_file!) +end +raise exception -- cgit v1.2.3