Skip to content

Commit

Permalink
Update deployment-support.yaml to fix UnboundLocalError (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
MustaphaU authored Dec 10, 2024
1 parent 14eae72 commit 9fd995a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aws/cloudformation-templates/deployment-support.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,17 @@ Resources:
# exit while, success.
break
except URLError as e:
error = e
retries += 1
print(f"Request failed. Retrying in 30 seconds... (Attempt {retries}/{max_retries})")
print(f"Error: {e}")
time.sleep(30)
#
if retries >= max_retries:
logger.error(f"Error calling product service init: {e.code} : {e.reason}")
logger.error(f"Error calling product service init: {error.reason}")
response_status = cfnresponse.FAILED
response_data['Message'] = f"Resource {event['RequestType']} failed: {e}"
response_data['Message'] = f"Resource {event['RequestType']} failed: {error}"
cfnresponse.send(event, context, response_status, response_data)
Expand Down

0 comments on commit 9fd995a

Please sign in to comment.