fix: deleting non-existent topic shouldn't raise KeyError (#3285)
This commit is contained in:
parent
16d5d2df28
commit
c321ad46b0
3 changed files with 19 additions and 1 deletions
|
|
@ -426,7 +426,10 @@ class SNSBackend(BaseBackend):
|
|||
return self._get_values_nexttoken(self.topics, next_token)
|
||||
|
||||
def delete_topic(self, arn):
|
||||
self.topics.pop(arn)
|
||||
try:
|
||||
self.topics.pop(arn)
|
||||
except KeyError:
|
||||
raise SNSNotFoundError("Topic with arn {0} not found".format(arn))
|
||||
|
||||
def get_topic(self, arn):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue