Skip to content

Commit

Permalink
chore: Make behaviour clear about returning in finally block
Browse files Browse the repository at this point in the history
  • Loading branch information
lucashuy committed Oct 24, 2024
1 parent 97e63dc commit 0b55a8a
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 0b55a8a

Please sign in to comment.