build: Propagate entire ErrorDuringExecution

Fixes https://github.com/Homebrew/brew/issues/5427.
This commit is contained in:
William Woodruff 2018-12-23 11:24:48 -05:00
parent a7832280c9
commit b7d84f2d9e
No known key found for this signature in database
GPG Key ID: 600D68320BE45ACC
2 changed files with 5 additions and 1 deletions

View File

@ -202,6 +202,10 @@ rescue Exception => e # rubocop:disable Lint/RescueException
error_hash["cmd"] = e.cmd error_hash["cmd"] = e.cmd
error_hash["args"] = e.args error_hash["args"] = e.args
error_hash["env"] = e.env 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 end
error_pipe.puts error_hash.to_json error_pipe.puts error_hash.to_json

View File

@ -300,7 +300,7 @@ end
def safe_system(cmd, *args, **options) def safe_system(cmd, *args, **options)
return if Homebrew.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 end
# Prints no output # Prints no output