Tools: size_compare_branches.py: upon process failure write out a file containing diagnostics

This commit is contained in:
Peter Barker 2024-01-12 10:22:47 +11:00 committed by Peter Barker
parent 1748711b99
commit 34bc01ec71

View File

@ -267,6 +267,12 @@ class SizeCompareBranches(object):
print(output) print(output)
self.progress("Process failed (%s)" % self.progress("Process failed (%s)" %
str(returncode)) str(returncode))
try:
path = pathlib.Path(self.tmpdir, f"process-failure-{int(time.time())}")
path.write_text(output)
self.progress("Wrote process failure file (%s)" % path)
except Exception:
self.progress("Writing process failure file failed")
raise subprocess.CalledProcessError( raise subprocess.CalledProcessError(
returncode, cmd_list) returncode, cmd_list)
return output return output