Merge pull request #676 from larsks/feature/notfound-on-404

return NotFound on 404 errors
This commit is contained in:
Aanand Prasad 2015-07-20 11:46:21 +01:00
commit 4cfb15737d
2 changed files with 6 additions and 0 deletions

View File

@ -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):

View File

@ -53,6 +53,10 @@ class DockerException(Exception):
pass
class NotFound(APIError):
pass
class InvalidVersion(DockerException):
pass