Skip to content

Commit 9c23c85

Browse files
committed
Add even more error messages
1 parent dc1f2dd commit 9c23c85

File tree

1 file changed

+12
-4
lines changed
  • tools/performance/engine-benchmarks/bench_tool

1 file changed

+12
-4
lines changed

tools/performance/engine-benchmarks/bench_tool/git.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ async def pull(repo: Path) -> None:
3535
proc = await asyncio.create_subprocess_exec("git", *args, cwd=repo, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
3636
ret = await proc.wait()
3737
if ret != 0:
38-
raise RuntimeError(f"Failed to pull {repo}")
38+
stdout, stderr = await proc.communicate()
39+
out = stdout.decode() + stderr.decode()
40+
raise RuntimeError(f"Failed to pull {repo}: {out}")
3941

4042

4143
async def status(repo: Path) -> GitStatus:
@@ -64,7 +66,9 @@ async def add(repo: Path, files: Set[str]) -> None:
6466
proc = await asyncio.create_subprocess_exec("git", *args, cwd=repo, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
6567
ret = await proc.wait()
6668
if ret != 0:
67-
raise RuntimeError(f"Failed to add {files} to {repo}")
69+
out, err = await proc.communicate()
70+
all_out = out.decode() + err.decode()
71+
raise RuntimeError(f"Failed to add {files} to {repo}. Output: {all_out}")
6872

6973

7074
async def commit(repo: Path, msg: str) -> None:
@@ -86,7 +90,9 @@ async def push(repo: Path) -> None:
8690
proc = await asyncio.create_subprocess_exec("git", *args, cwd=repo, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
8791
ret = await proc.wait()
8892
if ret != 0:
89-
raise RuntimeError(f"Failed to push {repo}")
93+
out, err = await proc.communicate()
94+
all_out = out.decode() + err.decode()
95+
raise RuntimeError(f"Failed to push {repo}. Output: {all_out}")
9096

9197

9298
async def init(repo: Path) -> None:
@@ -96,4 +102,6 @@ async def init(repo: Path) -> None:
96102
proc = await asyncio.create_subprocess_exec("git", *args, cwd=repo, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
97103
ret = await proc.wait()
98104
if ret != 0:
99-
raise RuntimeError(f"Failed to init {repo}")
105+
out, err = await proc.communicate()
106+
all_out = out.decode() + err.decode()
107+
raise RuntimeError(f"Failed to init {repo}. Output: {all_out}")

0 commit comments

Comments
 (0)