Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore FormulaUnreadableError in Formula.each. #8592

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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