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
1 changed files with 6 additions and 0 deletions

View File

@ -267,6 +267,12 @@ class SizeCompareBranches(object):
print(output)
self.progress("Process failed (%s)" %
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(
returncode, cmd_list)
return output