Merge pull request #3263 from MikeMcQuaid/formulary-unreadable-bottle-formula

formulary: handle unreadable bottle formula.
This commit is contained in:
Mike McQuaid 2017-10-04 11:38:36 +01:00 committed by GitHub
commit 113e5da55e

View File

@ -124,7 +124,15 @@ module Formulary
def get_formula(spec, **)
contents = Utils::Bottles.formula_contents @bottle_filename, name: name
formula = Formulary.from_contents name, @bottle_filename, contents, spec
formula = begin
Formulary.from_contents name, @bottle_filename, contents, spec
rescue FormulaUnreadableError => e
opoo <<-EOS.undent
Unreadable formula in #{@bottle_filename}:
#{e}
EOS
super
end
formula.local_bottle_path = @bottle_filename
formula
end