Stop rescuing NameError

This clause originated in 4a36c56ac7b36904712aa472b9bd50ef1b0c80d3,
attempting to catch NameErrors raised by const_defined? calls earlier in
the method body. Those const_defined? calls have since been moved out of
the body of the begin block.

Stop rescuing NameError here, which will make true programming errors in
formulae easier to debug.
This commit is contained in:
Jack Nagel 2014-12-31 11:13:45 -05:00
parent 86ec8fcff3
commit 2cb160dc46

View File

@ -74,11 +74,7 @@ class Formulary
STDERR.puts "#{$0} (#{self.class.name}): loading #{path}" if ARGV.debug? STDERR.puts "#{$0} (#{self.class.name}): loading #{path}" if ARGV.debug?
begin begin
require(path) require(path)
rescue NoMethodError rescue LoadError => e
# This is a programming error in an existing formula, and should not
# have a "no such formula" message.
raise
rescue LoadError, NameError => e
raise FormulaUnavailableError, name, e.backtrace raise FormulaUnavailableError, name, e.backtrace
end end
end end