From f1d0f7adbb98776910206686027097e889b693f9 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sun, 26 Aug 2012 17:06:38 -0700 Subject: [PATCH] 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. --- Library/Homebrew/formula.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index d4034564a8..2b3305d202 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