Skip to content
Snippets Groups Projects
Commit 8fb769e6 authored by Markus Reiter's avatar Markus Reiter
Browse files

Ignore `FormulaUnreadableError` in `Formula.each`.

parent 5ce013b0
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment