Skip to content

Commit

Permalink
[generator] More helpful logging of subprocess launch failures
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantin Pastbin <[email protected]>
  • Loading branch information
pastk authored and vng committed Sep 8, 2023
1 parent c266f34 commit 0931844
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/python/maps_generator/generator/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@ class FailedTest(MapsGeneratorError):

def wait_and_raise_if_fail(p):
if p.wait() != os.EX_OK:
raise BadExitStatusError(f"The launch of {' '.join(p.args)} failed.")
args = p.args
logs = p.output.name
if p.error.name != logs:
logs += " and " + p.error.name
msg = f"The launch of {args.pop(0)} failed.\nArguments used: {' '.join(args)}\nSee details in {logs}"
raise BadExitStatusError(msg)

0 comments on commit 0931844

Please sign in to comment.