Skip to content

Commit b5f990c

Browse files
committed
improved error handling
1 parent a393c77 commit b5f990c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

appveyor.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,19 @@ test_script:
9090
# Enable additional file formats
9191
$newSettings = New-Object PSCustomObject -Property @{"PropertyValues" = @( @{"@odata.type"="#Model.Property"; "Name" = "AllowedResourceExtensionsForUpload"; "Value" = "*,*.xml,*.xsd,*.xsl,*.png,*.gif,*.jpg,*.tif,*.jpeg,*.tiff,*.bmp,*.pdf,*.svg,*.rtf,*.txt,*.doc,*.docx,*.pps,*.ppt,*.pptx,*.xlsx"})}
9292
$stringNewRequest = $newSettings | ConvertTo-JSON -Depth 5
93-
for ($i=0 ; $i -le 10 -and $sucess -eq $false ;i++){
93+
$isAllowedFileFormatUpdated = $true
94+
for ($i=0 ; $i -le 10 -and $isAllowedFileFormatUpdated -eq $false ;i++){
9495
try{
95-
$sucess = $true;
96+
$isAllowedFileFormatUpdated = $true;
9697
Invoke-RestMethod -Uri "http://localhost/reports/api/v1.0/ReportServerInfo/Model.UpdateSettings" -Method POST -UseDefaultCredentials -ContentType 'application/json' -Body $stringNewRequest
9798
}
9899
catch (){
99-
$sucess = $false
100+
$isAllowedFileFormatUpdated = $false
100101
Start-Sleep -Seconds 1
101102
}
102103
}
104+
if (isAllowedFileFormatUpdated -eq $false) {throw (New-Object System.Exception("Failed to update the AllowedResourceExtensionsForUpload") }
105+
103106
104107
# Integration test section
105108
# Activate verbose on Powershell

0 commit comments

Comments
 (0)