Skip to content

Commit d50cc7b

Browse files
updated exit code condition
1 parent 6f58c23 commit d50cc7b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

infra/scripts/validate_model_deployment_quotas.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@ foreach ($deployment in $aiModelDeployments) {
5454
& .\infra\scripts\validate_model_quota.ps1 -Location $Location -Model $model -Capacity $capacity -DeploymentType $type
5555

5656
# Check if the script failed
57-
if ($LASTEXITCODE -ne 0) {
57+
$exitCode = $LASTEXITCODE
58+
59+
if ($exitCode -ne 0) {
60+
if ($exitCode -eq 2) {
61+
# Quota error already printed inside the script, exit gracefully without reprinting
62+
exit 1
63+
}
5864
Write-Error "❌ ERROR: Quota validation failed for model deployment: $name"
5965
$QuotaAvailable = $false
6066
}

0 commit comments

Comments
 (0)