diff options
author | Joffrey F <joffrey@docker.com> | 2015-07-20 13:52:15 -0700 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2015-07-20 13:52:15 -0700 |
commit | 933ee526baaac006f9a16620a1fcea6c0505f883 (patch) | |
tree | cf38a07e0e3deef747486009e19b101c715f54d0 | |
parent | 90f81ed328aa3901a58b7b0d55fce35905fb9393 (diff) | |
parent | 1f5ba4b25da911b90db9c2506664dfae70342ffc (diff) | |
download | docker-py-933ee526baaac006f9a16620a1fcea6c0505f883.tar.gz |
Merge branch 'master' of github.com:docker/docker-py
-rw-r--r-- | docker/clientbase.py | 2 | ||||
-rw-r--r-- | docker/errors.py | 4 | ||||
-rw-r--r-- | docs/api.md | 8 |
3 files changed, 12 insertions, 2 deletions
diff --git a/docker/clientbase.py b/docker/clientbase.py index c81ee0c..ce52ffa 100644 --- a/docker/clientbase.py +++ b/docker/clientbase.py @@ -99,6 +99,8 @@ class ClientBase(requests.Session): try: response.raise_for_status() except requests.exceptions.HTTPError as e: + if e.response.status_code == 404: + raise errors.NotFound(e, response, explanation=explanation) raise errors.APIError(e, response, explanation=explanation) def _result(self, response, json=False, binary=False): diff --git a/docker/errors.py b/docker/errors.py index d15e332..066406a 100644 --- a/docker/errors.py +++ b/docker/errors.py @@ -53,6 +53,10 @@ class DockerException(Exception): pass +class NotFound(APIError): + pass + + class InvalidVersion(DockerException): pass diff --git a/docs/api.md b/docs/api.md index f1e2d03..2dd175a 100644 --- a/docs/api.md +++ b/docs/api.md @@ -511,7 +511,7 @@ Kill a container or send a signal to a container **Params**: * container (str): The container to kill -* signal (str or int): The singal to send. Defaults to `SIGKILL` +* signal (str or int): The signal to send. Defaults to `SIGKILL` ## load_image @@ -726,6 +726,10 @@ Identical to the `docker search` command. Similar to the `docker start` command, but doesn't support attach options. Use `.logs()` to recover `stdout`/`stderr`. +**Params**: + +* container (str): The container to start + **Deprecation warning:** For API version > 1.15, it is highly recommended to provide host config options in the [`host_config` parameter of `create_container`](#create_container) @@ -748,7 +752,7 @@ This will stream statistics for a specific container. **Params**: -* container (str): The container to start +* container (str): The container to stream statistics for * decode (bool): If set to true, stream will be decoded into dicts on the fly. False by default. |