Skip to content

Commit e9d50fc

Browse files
committed
add better error message
1 parent 7c0e971 commit e9d50fc

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

cwltool/job.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,14 @@ def run(self,
623623
img_id = str(docker_req["dockerPull"])
624624
cmd = [user_space_docker_cmd, "pull", img_id]
625625
_logger.info(Text(cmd))
626-
subprocess.check_call(cmd, stdout=sys.stderr)
626+
try:
627+
subprocess.check_call(cmd, stdout=sys.stderr)
628+
except OSError:
629+
raise WorkflowException(SourceLine(docker_req).makeError(
630+
"Either Docker container {} is not available with "
631+
"user space docker implementation {} or {} is missing "
632+
"or broken.".format(img_id, user_space_docker_cmd,
633+
user_space_docker_cmd)))
627634
else:
628635
raise WorkflowException(SourceLine(docker_req).makeError(
629636
"Docker image must be specified as 'dockerImageId' or "

tests/test_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ def test_bad_userspace_runtime(factor):
954954
"--user-space-docker-cmd=quaquioN", "--default-container=debian",
955955
get_data(test_file), get_data(job_file)])
956956
error_code, stdout, stderr = get_main_output(commands)
957-
assert "'quaquioN' not found:" in stderr or "No such file or directory: 'quaquioN'" in stderr, stderr
957+
assert "or quaquioN is missing or broken" in stderr, stderr
958958
assert error_code == 1
959959

960960
@windows_needs_docker

0 commit comments

Comments
 (0)