Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SqsEventSource.status error handling in utilities.py #1318

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions zappa/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

@monkut monkut Apr 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This raise changes the current operation of the status() function. I'm not sure if it's desired to raise an exception here.

Also, there is no e defined, this is expected raise a NameError exception as-is.

else:
LOG.debug("No UUID for event source %s", self.arn)
return response
Expand Down