Skip to content

Commit 58b555a

Browse files
committed
Enh: More info for docker pull errors
1 parent 2274f62 commit 58b555a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/swerex/deployment/docker.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ def _is_image_available(image: str) -> bool:
3131

3232

3333
def _pull_image(image: str) -> bytes:
34-
return subprocess.check_output(["docker", "pull", image])
34+
try:
35+
return subprocess.check_output(["docker", "pull", image], stderr=subprocess.PIPE)
36+
except subprocess.CalledProcessError as e:
37+
# e.stderr contains the error message as bytes
38+
raise subprocess.CalledProcessError(e.returncode, e.cmd, e.output, e.stderr) from None
3539

3640

3741
def _remove_image(image: str) -> bytes:

0 commit comments

Comments
 (0)