2017-08-10 19:33:38 -04:00
|
|
|
from __future__ import unicode_literals
|
2020-03-08 20:56:21 +01:00
|
|
|
from moto.core.exceptions import RESTError, JsonRESTError
|
2017-08-10 19:33:38 -04:00
|
|
|
|
|
|
|
|
|
|
|
class RepositoryNotFoundException(RESTError):
|
|
|
|
code = 400
|
|
|
|
|
|
|
|
def __init__(self, repository_name, registry_id):
|
|
|
|
super(RepositoryNotFoundException, self).__init__(
|
|
|
|
error_type="RepositoryNotFoundException",
|
|
|
|
message="The repository with name '{0}' does not exist in the registry "
|
2019-10-31 08:44:26 -07:00
|
|
|
"with id '{1}'".format(repository_name, registry_id),
|
|
|
|
)
|
2017-08-10 19:33:38 -04:00
|
|
|
|
|
|
|
|
2020-03-08 20:56:21 +01:00
|
|
|
class ImageNotFoundException(JsonRESTError):
|
2017-08-10 19:33:38 -04:00
|
|
|
code = 400
|
|
|
|
|
|
|
|
def __init__(self, image_id, repository_name, registry_id):
|
|
|
|
super(ImageNotFoundException, self).__init__(
|
|
|
|
error_type="ImageNotFoundException",
|
|
|
|
message="The image with imageId {0} does not exist within the repository with name '{1}' "
|
2019-10-31 08:44:26 -07:00
|
|
|
"in the registry with id '{2}'".format(
|
|
|
|
image_id, repository_name, registry_id
|
|
|
|
),
|
|
|
|
)
|