diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 99745cdb8b..02928cf3fd 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -208,6 +208,7 @@ class FormulaUnreadableError < FormulaUnavailableError def initialize(name, error) super(name) @formula_error = error + set_backtrace(error.backtrace) end end @@ -257,6 +258,7 @@ class TapFormulaUnreadableError < TapFormulaUnavailableError def initialize(tap, name, error) super(tap, name) @formula_error = error + set_backtrace(error.backtrace) end end diff --git a/Library/Homebrew/test/cli/named_args_spec.rb b/Library/Homebrew/test/cli/named_args_spec.rb index 0f734816a7..06e85a7344 100644 --- a/Library/Homebrew/test/cli/named_args_spec.rb +++ b/Library/Homebrew/test/cli/named_args_spec.rb @@ -4,7 +4,7 @@ require "cli/named_args" def setup_unredable_formula(name) - error = FormulaUnreadableError.new(name, "testing") + error = FormulaUnreadableError.new(name, RuntimeError.new("testing")) allow(Formulary).to receive(:factory).with(name, force_bottle: false, flags: []).and_raise(error) end