moto/moto/secretsmanager/exceptions.py

54 lines
1.5 KiB
Python
Raw Normal View History

from __future__ import unicode_literals
from moto.core.exceptions import JsonRESTError
class SecretsManagerClientError(JsonRESTError):
code = 400
class ResourceNotFoundException(SecretsManagerClientError):
def __init__(self, message):
self.code = 404
super(ResourceNotFoundException, self).__init__(
"ResourceNotFoundException",
message,
)
class SecretNotFoundException(SecretsManagerClientError):
def __init__(self):
self.code = 404
super(SecretNotFoundException, self).__init__(
"ResourceNotFoundException",
message=u"Secrets Manager can\u2019t find the specified secret."
)
class ClientError(SecretsManagerClientError):
def __init__(self, message):
super(ClientError, self).__init__(
'InvalidParameterValue',
message)
class InvalidParameterException(SecretsManagerClientError):
def __init__(self, message):
super(InvalidParameterException, self).__init__(
'InvalidParameterException',
message)
2019-04-18 12:58:50 +01:00
class ResourceExistsException(SecretsManagerClientError):
def __init__(self, message):
super(ResourceExistsException, self).__init__(
'ResourceExistsException',
message
)
2019-04-18 12:58:50 +01:00
class InvalidRequestException(SecretsManagerClientError):
def __init__(self, message):
super(InvalidRequestException, self).__init__(
'InvalidRequestException',
2019-04-18 16:53:27 +01:00
message)