Skip to content

Commit 0f65b61

Browse files
committed
chore: update error messages
Signed-off-by: Kevin Shan <[email protected]>
1 parent 4b3c735 commit 0f65b61

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

shared-scripts.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,13 @@ function useChildAccountCredentials {
361361
fi
362362
session_id=$((1 + $RANDOM % 10000))
363363
if [[ -z "$pick_acct" || -z "$session_id" ]]; then
364-
echo "Unable to find a child account. Falling back to parent AWS account"
365-
return
364+
echo "Unable to find a child account. Fatal error and test run aborted"
365+
exit 1
366366
fi
367367
creds=$(aws sts assume-role --role-arn arn:aws:iam::${pick_acct}:role/OrganizationAccountAccessRole --role-session-name testSession${session_id} --duration-seconds 3600)
368368
if [ -z $(echo $creds | jq -c -r '.AssumedRoleUser.Arn') ]; then
369-
echo "Unable to assume child account role. Falling back to parent AWS account"
370-
return
369+
echo "Unable to assume child account role. Fatal error and test run aborted"
370+
exit 1
371371
fi
372372
export ORGANIZATION_SIZE=$org_size
373373
export CREDS=$creds

0 commit comments

Comments
 (0)