From b7d84f2d9e6b0c44c712dab7987ee3244f80062a Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Sun, 23 Dec 2018 11:24:48 -0500 Subject: [PATCH] build: Propagate entire ErrorDuringExecution Fixes https://github.com/Homebrew/brew/issues/5427. --- Library/Homebrew/build.rb | 4 ++++ Library/Homebrew/utils.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index 82acee2a44..e2f64013a9 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -202,6 +202,10 @@ rescue Exception => e # rubocop:disable Lint/RescueException error_hash["cmd"] = e.cmd error_hash["args"] = e.args error_hash["env"] = e.env + elsif error_hash["json_class"] = "ErrorDuringExecution" + error_hash["cmd"] = e.cmd + error_hash["status"] = e.status.exitstatus + error_hash["output"] = e.output end error_pipe.puts error_hash.to_json diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 8d20dc2444..ff69087139 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -300,7 +300,7 @@ end def safe_system(cmd, *args, **options) return if Homebrew.system(cmd, *args, **options) - raise(ErrorDuringExecution.new([cmd, *args], status: $CHILD_STATUS)) + raise ErrorDuringExecution.new([cmd, *args], status: $CHILD_STATUS) end # Prints no output