Use specific exception to prevent repetition

This commit is contained in:
Alexander Campbell 2019-10-18 10:09:16 +11:00
commit 4eb921480e
2 changed files with 17 additions and 7 deletions

View file

@ -15,6 +15,15 @@ class ResourceNotFoundException(SecretsManagerClientError):
)
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__(