diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index de6596ff15..3e016f64b4 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -2324,7 +2324,8 @@ class Formula # @api public def inreplace(paths, before = nil, after = nil, audit_result = true) # rubocop:disable Style/OptionalBooleanParameter super(paths, before, after, audit_result) - rescue Utils::Inreplace::Error + rescue Utils::Inreplace::Error => e + onoe e.to_s raise BuildError.new(self, "inreplace", paths, {}) end