mirror of https://github.com/docker/docker-py.git
Merge pull request #676 from larsks/feature/notfound-on-404
return NotFound on 404 errors
This commit is contained in:
commit
4cfb15737d
|
|
@ -99,6 +99,8 @@ class ClientBase(requests.Session):
|
||||||
try:
|
try:
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
except requests.exceptions.HTTPError as e:
|
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)
|
raise errors.APIError(e, response, explanation=explanation)
|
||||||
|
|
||||||
def _result(self, response, json=False, binary=False):
|
def _result(self, response, json=False, binary=False):
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,10 @@ class DockerException(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class NotFound(APIError):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class InvalidVersion(DockerException):
|
class InvalidVersion(DockerException):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue