Skip to content

Commit

Permalink
Merge pull request #8592 from reitermarkus/desc-cache-ignore-exceptions
Browse files Browse the repository at this point in the history
Ignore `FormulaUnreadableError` in `Formula.each`.
  • Loading branch information
reitermarkus authored Sep 3, 2020
2 parents 197e1f3 + 8fb769e commit 2dbaaf3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1460,14 +1460,12 @@ def self.full_names
# @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

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/formulary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def self.load_formula(name, path, contents, namespace, flags:)
# 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
Expand Down

0 comments on commit 2dbaaf3

Please sign in to comment.