You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off I just wanted to express my gratitude for this library and all of the work that has gone into it. It's been very helpful for my project and is much cleaner than docker-py.
I am trying to write some logic to see if an image exists locally, then attempt to pull it if it doesn't, while handling everything gracefully.
docker.image.inspect() is great for checking if an image exists locally, proper error handling and doesn't muddy up stdout.
However, docker.pull() doesn't try to catch any exceptions and spits out some junk to stdout.
I propose a try/catch around docker.pull that raises a NoSuchImage if the pull fails.
The text was updated successfully, but these errors were encountered:
First of all, many thanks for the kind words, those are what keep the maintainers going!
Second, that would be a great addition to python-on-whales to have specific exceptions in docker.pull() depending on the reasons for failure. We can get the information from stderr or from the exit code (if the exit code differs depending on the reason for failing). I'm open for pull requests in this direction as long as it doesn't complexify the codebase too much!
First off I just wanted to express my gratitude for this library and all of the work that has gone into it. It's been very helpful for my project and is much cleaner than
docker-py
.I am trying to write some logic to see if an image exists locally, then attempt to pull it if it doesn't, while handling everything gracefully.
docker.image.inspect()
is great for checking if an image exists locally, proper error handling and doesn't muddy up stdout.However,
docker.pull()
doesn't try to catch any exceptions and spits out some junk to stdout.I propose a try/catch around docker.pull that raises a NoSuchImage if the pull fails.
The text was updated successfully, but these errors were encountered: