From 2e546f7e26fec006dd18119d4857580ec9ccd540 Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Thu, 16 Jul 2015 15:10:07 -0400 Subject: return NotFound on 404 errors This changes raises docker.errors.NotFound on 404 errors. This gives client code the ability to differentiate between "an image does not exist" and "you are using the api incorrectly". This inherits from docker.errors.APIError so it will not affect any existing code. --- docker/errors.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docker/errors.py') 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 -- cgit v1.2.1