Skip to content

Commit

Permalink
Fix: runtime error #17 (comment)
Browse files Browse the repository at this point in the history
Signed-off-by: Isaac Saito <[email protected]>
  • Loading branch information
130s committed Sep 21, 2023
1 parent a93cbd1 commit 5543b33
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
name_package_lib = "docker_vcs_lib"

setup(
version="0.1.10",
version="0.1.12",
author="Isaac Saito",
author_email="[email protected]",
classifiers=[
Expand All @@ -25,7 +25,7 @@
],
entry_points={
'console_scripts': [
'docker_vcs = docker_vcs_lib.docker_vcs:main'
'docker_vcs = docker_vcs_lib.docker_vcs:__main__'
],
},
description="A Python package that provides convenience utility for Docker, vcstool (another tool that provides utility for VCS), as well as rosdep.",
Expand Down
11 changes: 9 additions & 2 deletions src/docker_vcs_lib/docker_builder_vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import json
import logging
import os
from requests.exceptions import ConnectionError
import pathlib
import sh
import shlex
Expand Down Expand Up @@ -42,8 +43,14 @@ class DockerBuilderVCS():
def __init__(self):
try:
self._docker_client = docker.from_env()
except (docker.errors.APIError, docker.errors.TLSParameterError) as e:
logging.error(str(e))
except (docker.errors.DockerException, docker.errors.APIError, docker.errors.TLSParameterError, ConnectionError) as e:
# Message hinted from https://github.com/osrf/rocker/pull/215
msg = ("Docker Client failed to connect to docker daemon."
" Please verify that docker is installed and running."
" As well as that you have permission to access the docker daemon."
" This is usually by being a member of the docker group."
" The underlying error was:\n{}".format(str(e)))
logging.error(msg)
exit(1)
pass

Expand Down

0 comments on commit 5543b33

Please sign in to comment.