Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Docker daemon connection error message #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gz1z
Copy link
Collaborator

@gz1z gz1z commented Dec 8, 2024

When Docker daemon is not running, the current error message is cryptic and not helpful:

Error while fetching server API version: ("Connection aborted.", FileNotFoundError(2, "No such file or directory"))

This PR improves the error message to be more user-friendly and actionable:

RuntimeError: Failed to connect to Docker daemon. Please make sure Docker is installed and running on your system.

The change wraps the Docker client initialization in a try-catch block and specifically looks for the FileNotFoundError case, which occurs when the Docker daemon is not running or the socket file is not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants