From 71f9ec79c70ab3d171b71296375f17dd4bbbc4d5 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Thu, 30 Jul 2020 16:59:19 +0100 Subject: [PATCH] formula: don't catch errors in the Formula.each yield --- Library/Homebrew/formula.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index ad385131e4..a56ebfc1fb 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1461,12 +1461,14 @@ class Formula # @private def self.each files.each do |file| - yield Formulary.factory(file) - rescue => e - # Don't let one broken formula break commands. But do complain. - onoe "Failed to import: #{file}" - puts e - next + 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 end end