Browse Source

Update NuGet package push script to improve error handling for 4xx responses. Changed warning message to reflect the new error condition and ensure clarity during retries.

pull/25246/head
selmankoc 6 months ago
parent
commit
bb587dcc30
  1. 6
      nupkg/push_packages.ps1

6
nupkg/push_packages.ps1

@ -39,8 +39,8 @@ foreach($project in $projects) {
break break
} }
$quotaExceeded = ($pushOutput | Out-String) -match "403 \(Quota Exceeded\)" $clientError = ($pushOutput | Out-String) -match "Response status code does not indicate success:\s*4\d\d"
$canRetry = $quotaExceeded -and $attempt -le $maxQuotaRetryCount $canRetry = $clientError -and $attempt -le $maxQuotaRetryCount
if (-not $canRetry) if (-not $canRetry)
{ {
@ -48,7 +48,7 @@ foreach($project in $projects) {
} }
$retryDelay = $quotaRetryDelaysInSeconds[$attempt - 1] $retryDelay = $quotaRetryDelaysInSeconds[$attempt - 1]
Write-Warning "NuGet quota exceeded for $nugetPackageName. Retrying in $retryDelay seconds (retry $attempt/$maxQuotaRetryCount)..." Write-Warning "NuGet push returned a 4xx response for $nugetPackageName. Retrying in $retryDelay seconds (retry $attempt/$maxQuotaRetryCount)..."
Start-Sleep -Seconds $retryDelay Start-Sleep -Seconds $retryDelay
} }
#Write-Host ("Deleting package from local: " + $nugetPackageName) #Write-Host ("Deleting package from local: " + $nugetPackageName)

Loading…
Cancel
Save