From 6eb80c67a43a908883ceb9303806c910c48b04d5 Mon Sep 17 00:00:00 2001 From: Michka Popoff Date: Thu, 25 Jun 2020 22:17:45 +0200 Subject: [PATCH] install: add backtrace on failure The error message might be useless alone --- Library/Homebrew/cmd/install.rb | 1 + Library/Homebrew/formulary.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index ef95b00c76..d6ad01feef 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -267,6 +267,7 @@ module Homebrew # Need to rescue before `FormulaUnavailableError` (superclass of this) # is handled, as searching for a formula doesn't make sense here (the # formula was found, but there's a problem with its implementation). + $stderr.puts e.backtrace if Homebrew::EnvConfig.developer? ofail e.message rescue FormulaUnavailableError => e if e.name == "updog" diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 086d8ff61f..336f34f757 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -35,6 +35,7 @@ module Formulary begin mod.module_eval(contents, path) rescue NameError, ArgumentError, ScriptError => e + $stderr.puts e.backtrace if Homebrew::EnvConfig.developer? raise FormulaUnreadableError.new(name, e) end class_name = class_s(name)