From b0354798a510a5cddbd4d226867213fdf958a8b4 Mon Sep 17 00:00:00 2001 From: hj Date: Fri, 16 Aug 2024 22:26:45 +0530 Subject: [PATCH] add error handling for aws credentials --- apps/challenges/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/challenges/utils.py b/apps/challenges/utils.py index cfbaaec90b..6c859fb081 100644 --- a/apps/challenges/utils.py +++ b/apps/challenges/utils.py @@ -383,6 +383,8 @@ def get_aws_credentials_for_submission(challenge, participant_team): repository, created = get_or_create_ecr_repository( ecr_repository_name, aws_keys ) + if repository is None: + raise ValueError("Failed to create or retrieve ECR repository") name = str(uuid.uuid4())[:32] docker_repository_uri = repository["repositoryUri"] federated_user = create_federated_user(name, ecr_repository_name, aws_keys)