From 1fbeb098ef06a2965d57c4fcc90be6af1e15fc85 Mon Sep 17 00:00:00 2001 From: Luke Muther <80649402+lmuther8@users.noreply.github.com> Date: Fri, 29 Mar 2024 14:38:16 -0400 Subject: [PATCH] Fix SqsEventSource.status error handling in utilities.py --- zappa/utilities.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zappa/utilities.py b/zappa/utilities.py index 132ff1fe5..1a82070da 100644 --- a/zappa/utilities.py +++ b/zappa/utilities.py @@ -360,8 +360,12 @@ def status(self, function): response = self._lambda.call("get_event_source_mapping", UUID=self._get_uuid(function)) LOG.debug(response) except botocore.exceptions.ClientError: - LOG.debug("event source %s does not exist", self.arn) - response = None + # https://github.com/zappa/Zappa/issues/1317 + if e.response['Error']['Code'] == 'ResourceNotFoundException': + LOG.debug("event source %s does not exist", self.arn) + response = None + else: + raise e else: LOG.debug("No UUID for event source %s", self.arn) return response