diff options
| author | Adam Vandenberg | 2012-08-26 17:06:38 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2012-08-26 17:06:38 -0700 |
| commit | 05970688271d18a2357f48a06de8fa3b9fbf74f2 (patch) | |
| tree | 20946b28082d87e4cd12cc1450c3097c9a39e6c5 /Library | |
| parent | 90a063b9e9b4aecf07cf367928d17d7b7e245acc (diff) | |
| download | homebrew-05970688271d18a2357f48a06de8fa3b9fbf74f2.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 #14467.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula.rb | 4 |
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 |
