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

chore: Make behaviour clear about returning in finally block #7605

Merged
merged 1 commit into from
Oct 28, 2024
Merged
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
5 changes: 5 additions & 0 deletions samcli/local/apigw/local_apigw_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,11 @@ def _request_handler(self, **kwargs):
LOG.error("Lambda authorizer failed to invoke successfully: %s", str(lambda_authorizer_exception))

if auth_service_error:
# Return the Flask service error if there is one, since these are the only exceptions
# we are anticipating from the authorizer, anything else indicates a local issue.
#
# Note that returning within a finally block will have the effect of swallowing
# any reraised exceptions.
return auth_service_error

endpoint_service_error = None
Expand Down
Loading