diff --git a/src/helperFunctions/docker.py b/src/helperFunctions/docker.py index a541fb5ba..144a70d9c 100644 --- a/src/helperFunctions/docker.py +++ b/src/helperFunctions/docker.py @@ -4,14 +4,14 @@ import docker from docker.errors import APIError, DockerException, ImageNotFound -from requests.exceptions import ReadTimeout +from requests.exceptions import ReadTimeout, RequestException def run_docker_container( image: str, logging_label: str = 'Docker', timeout: int = 300, combine_stderr_stdout: bool = False, **kwargs ) -> CompletedProcess: """ - This is a convinience function that runs a docker container and returns a + This is a convenience function that runs a docker container and returns a subprocess.CompletedProcess instance for the command ran in the container. All remaining keyword args are passed to `docker.containers.run`. @@ -51,6 +51,9 @@ def run_docker_container( except ReadTimeout: logging.warning(f'[{logging_label}]: timeout while processing') raise + except RequestException: + logging.warning(f'[{logging_label}]: connection error while processing') + raise except APIError: logging.warning(f'[{logging_label}]: encountered docker error while processing') raise