install: add backtrace on failure

The error message might be useless alone
This commit is contained in:
Michka Popoff 2020-06-25 22:17:45 +02:00
parent 1df0a62532
commit 6eb80c67a4
2 changed files with 2 additions and 0 deletions

View File

@ -267,6 +267,7 @@ module Homebrew
# Need to rescue before `FormulaUnavailableError` (superclass of this) # Need to rescue before `FormulaUnavailableError` (superclass of this)
# is handled, as searching for a formula doesn't make sense here (the # is handled, as searching for a formula doesn't make sense here (the
# formula was found, but there's a problem with its implementation). # formula was found, but there's a problem with its implementation).
$stderr.puts e.backtrace if Homebrew::EnvConfig.developer?
ofail e.message ofail e.message
rescue FormulaUnavailableError => e rescue FormulaUnavailableError => e
if e.name == "updog" if e.name == "updog"

View File

@ -35,6 +35,7 @@ module Formulary
begin begin
mod.module_eval(contents, path) mod.module_eval(contents, path)
rescue NameError, ArgumentError, ScriptError => e rescue NameError, ArgumentError, ScriptError => e
$stderr.puts e.backtrace if Homebrew::EnvConfig.developer?
raise FormulaUnreadableError.new(name, e) raise FormulaUnreadableError.new(name, e)
end end
class_name = class_s(name) class_name = class_s(name)