Merge pull request #94 from snazy2000/revert-93-fix/invoke-snipeitmethod-error-handling-#91

Revert "If api request to snipe  fails, don't continue, just throw error"
This commit is contained in:
Petri Asikainen 2021-05-17 08:41:08 +03:00 committed by GitHub
commit c906c15890
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,9 +72,8 @@
$webResponse = Invoke-WebRequest @splatParameters $webResponse = Invoke-WebRequest @splatParameters
} }
catch { catch {
#Write-Verbose "[$($MyInvocation.MyCommand.Name)] Failed to get an answer from the server" Write-Verbose "[$($MyInvocation.MyCommand.Name)] Failed to get an answer from the server"
#$webResponse = $_.Exception.Response $webResponse = $_.Exception.Response
throw "[$($MyInvocation.MyCommand.Name)] Failed to get an answer from the server. $($_.Exception.Response)"
} }
Write-Debug "[$($MyInvocation.MyCommand.Name)] Executed WebRequest. Access $webResponse to see details" Write-Debug "[$($MyInvocation.MyCommand.Name)] Executed WebRequest. Access $webResponse to see details"