diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 79e4c946bdc450b1e6ede30a9c86f4779c6b474a..28e79c68f872d3510dce5bb2ed54b0a99a3674b5 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -23,8 +23,12 @@ class Formulary begin mod.const_get(class_name) - rescue NameError => e - raise FormulaUnavailableError, name, e.backtrace + rescue NameError => original_exception + class_list = mod.constants. + map { |const_name| mod.const_get(const_name) }. + select { |const| const.is_a?(Class) } + e = FormulaClassUnavailableError.new(name, path, class_name, class_list) + raise e, "", original_exception.backtrace end end