mirror of
https://github.com/snazy2000/SnipeitPS.git
synced 2025-12-13 01:42:29 +00:00
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:
commit
c906c15890
1 changed files with 2 additions and 3 deletions
|
|
@ -72,9 +72,8 @@
|
|||
$webResponse = Invoke-WebRequest @splatParameters
|
||||
}
|
||||
catch {
|
||||
#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-Verbose "[$($MyInvocation.MyCommand.Name)] Failed to get an answer from the server"
|
||||
$webResponse = $_.Exception.Response
|
||||
}
|
||||
|
||||
Write-Debug "[$($MyInvocation.MyCommand.Name)] Executed WebRequest. Access $webResponse to see details"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue