aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2012-08-26 17:06:38 -0700
committerAdam Vandenberg2012-08-26 17:06:38 -0700
commitf1d0f7adbb98776910206686027097e889b693f9 (patch)
treed15c6c824e0b30e90010ee1b4915a40f4c8b953f /Library
parent757b73e9a96c4ac1f3ccbb578a0b5248457f4e34 (diff)
downloadbrew-f1d0f7adbb98776910206686027097e889b693f9.tar.bz2
Formula factory: re-raise certain NameErrors.
Some name errors, such as NoMethodError, represent programming errors. Re-raise them to get a usable error message. Closes Homebrew/homebrew#14467.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index d4034564a..2b3305d20 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -405,6 +405,10 @@ class Formula
return klass.new(name) if install_type == :from_name
return klass.new(name, path.to_s)
+ rescue NoMethodError
+ # This is a programming error in an existing formula, and should not
+ # have a "no such formula" message.
+ raise
rescue LoadError, NameError
raise FormulaUnavailableError.new(name)
end