moto/moto/sns/exceptions.py
aantillonl d382731a14
Remove duplicate template of SNS error response (#3647)
In e9dc5edf7f a custom error template
was added to correct the response returned by get_endpoint_attributes
for a non-existent endpoint.

However, after some more inspection, it was found that a valid
template already existed in moto/sns/responses.py.

This commit removes the template introduced in e9dc5ed and takes
into use the existing template.

It is a marginal improvement, but helps keeping a cleaner code
base

Co-authored-by: Antillon, Alejandro <alejandro.antillon@f-secure.com>
2021-02-01 14:58:48 +00:00

64 lines
1.5 KiB
Python

from __future__ import unicode_literals
from moto.core.exceptions import RESTError
class SNSNotFoundError(RESTError):
code = 404
def __init__(self, message, **kwargs):
super(SNSNotFoundError, self).__init__("NotFound", message, **kwargs)
class ResourceNotFoundError(RESTError):
code = 404
def __init__(self):
super(ResourceNotFoundError, self).__init__(
"ResourceNotFound", "Resource does not exist"
)
class DuplicateSnsEndpointError(RESTError):
code = 400
def __init__(self, message):
super(DuplicateSnsEndpointError, self).__init__("DuplicateEndpoint", message)
class SnsEndpointDisabled(RESTError):
code = 400
def __init__(self, message):
super(SnsEndpointDisabled, self).__init__("EndpointDisabled", message)
class SNSInvalidParameter(RESTError):
code = 400
def __init__(self, message):
super(SNSInvalidParameter, self).__init__("InvalidParameter", message)
class InvalidParameterValue(RESTError):
code = 400
def __init__(self, message):
super(InvalidParameterValue, self).__init__("InvalidParameterValue", message)
class TagLimitExceededError(RESTError):
code = 400
def __init__(self):
super(TagLimitExceededError, self).__init__(
"TagLimitExceeded",
"Could not complete request: tag quota of per resource exceeded",
)
class InternalError(RESTError):
code = 500
def __init__(self, message):
super(InternalError, self).__init__("InternalFailure", message)