parent
bb46cc933d
commit
ea2e17cc11
9 changed files with 91 additions and 71 deletions
|
@ -1,7 +1,10 @@
|
|||
class V2RegistryException(Exception):
|
||||
def __init__(self, error_code_str, message, detail, http_status_code=400):
|
||||
def __init__(self, error_code_str, message, detail, http_status_code=400,
|
||||
repository=None, scopes=None):
|
||||
super(V2RegistryException, self).__init__(message)
|
||||
self.http_status_code = http_status_code
|
||||
self.repository = repository
|
||||
self.scopes = scopes
|
||||
|
||||
self._error_code_str = error_code_str
|
||||
self._detail = detail
|
||||
|
@ -104,11 +107,13 @@ class TagInvalid(V2RegistryException):
|
|||
|
||||
|
||||
class Unauthorized(V2RegistryException):
|
||||
def __init__(self, detail=None):
|
||||
def __init__(self, detail=None, repository=None, scopes=None):
|
||||
super(Unauthorized, self).__init__('UNAUTHORIZED',
|
||||
'access to the requested resource is not authorized',
|
||||
detail,
|
||||
401)
|
||||
401,
|
||||
repository=repository,
|
||||
scopes=scopes)
|
||||
|
||||
|
||||
class Unsupported(V2RegistryException):
|
||||
|
|
Reference in a new issue