Change error message when trying to pull a deleted or expired tag

Will let the users know they can recover the tag via time machine

Note: This was tested with the Docker protocol, but the new error code is *technically* out of spec; we should make sure its okay.
This commit is contained in:
Joseph Schorr 2017-06-21 21:58:16 -04:00
parent 99d7fde8ee
commit 7d4fed6892
7 changed files with 39 additions and 7 deletions

View file

@ -57,6 +57,13 @@ class ManifestUnknown(V2RegistryException):
def __init__(self, detail=None):
super(ManifestUnknown, self).__init__('MANIFEST_UNKNOWN', 'manifest unknown', detail, 404)
class TagExpired(V2RegistryException):
def __init__(self, message=None, detail=None):
super(TagExpired, self).__init__('TAG_EXPIRED',
message or 'Tag has expired',
detail,
404)
class ManifestUnverified(V2RegistryException):
def __init__(self, detail=None):