mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 01:42:29 +00:00
If apirequest fails, dont continue, just throw error
This commit is contained in:
parent
cb66a0112a
commit
738b4c6051
1 changed files with 3 additions and 2 deletions
|
|
@ -72,8 +72,9 @@
|
|||
$webResponse = Invoke-WebRequest @splatParameters
|
||||
}
|
||||
catch {
|
||||
Write-Verbose "[$($MyInvocation.MyCommand.Name)] Failed to get an answer from the server"
|
||||
$webResponse = $_.Exception.Response
|
||||
#Write-Verbose "[$($MyInvocation.MyCommand.Name)] Failed to get an answer from the server"
|
||||
#$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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue