moto/moto/kms/exceptions.py

53 lines
1.3 KiB
Python
Raw Normal View History

from __future__ import unicode_literals
from moto.core.exceptions import JsonRESTError
class NotFoundException(JsonRESTError):
code = 400
def __init__(self, message):
2019-10-31 15:44:26 +00:00
super(NotFoundException, self).__init__("NotFoundException", message)
class ValidationException(JsonRESTError):
code = 400
def __init__(self, message):
2019-10-31 15:44:26 +00:00
super(ValidationException, self).__init__("ValidationException", message)
class AlreadyExistsException(JsonRESTError):
code = 400
def __init__(self, message):
2019-10-31 15:44:26 +00:00
super(AlreadyExistsException, self).__init__("AlreadyExistsException", message)
class NotAuthorizedException(JsonRESTError):
code = 400
def __init__(self):
2019-10-31 15:44:26 +00:00
super(NotAuthorizedException, self).__init__("NotAuthorizedException", None)
self.description = '{"__type":"NotAuthorizedException"}'
class AccessDeniedException(JsonRESTError):
code = 400
def __init__(self, message):
2019-10-31 15:44:26 +00:00
super(AccessDeniedException, self).__init__("AccessDeniedException", message)
self.description = '{"__type":"AccessDeniedException"}'
class InvalidCiphertextException(JsonRESTError):
code = 400
def __init__(self):
super(InvalidCiphertextException, self).__init__(
2019-10-31 15:44:26 +00:00
"InvalidCiphertextException", None
)
self.description = '{"__type":"InvalidCiphertextException"}'