diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index fb764285c96becb77e4324df6e1c0008ca4dc5c4..f2a03f1980eedc2dad34722b76b7e2b6eb80cb30 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1460,14 +1460,12 @@ class Formula # @private def self.each files.each do |file| - yield begin - Formulary.factory(file) - rescue FormulaUnavailableError => e - # Don't let one broken formula break commands. But do complain. - onoe "Failed to import: #{file}" - puts e - next - end + yield Formulary.factory(file) + rescue FormulaUnavailableError, FormulaUnreadableError => e + # Don't let one broken formula break commands. But do complain. + onoe "Failed to import: #{file}" + $stderr.puts e + next end end diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 844000d618fff52b8456d0122bb1c88f12e869b0..8b10df02202a709c03e492b20cc3bfb28731e750 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -42,7 +42,7 @@ module Formulary # access them from within the formula's class scope. mod.const_set(:BUILD_FLAGS, flags) mod.module_eval(contents, path) - rescue NameError, ArgumentError, ScriptError => e + rescue NameError, ArgumentError, ScriptError, MethodDeprecatedError => e $stderr.puts e.backtrace if Homebrew::EnvConfig.developer? raise FormulaUnreadableError.new(name, e) end