Skip to content

Commit 70e9edc

Browse files
Invoke-ADORestAPI: Including StatusCode and StatusDescription in error message (fixes #115)
1 parent 5e21f0b commit 70e9edc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Invoke-ADORestAPI.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ $($MyInvocation.MyCommand.Name) @parameter
372372
$streamIn.Dispose()
373373
$PSCmdlet.WriteError(
374374
[Management.Automation.ErrorRecord]::new(
375-
[Exception]::new($strResponse, $ex.Exception.InnerException
375+
[Exception]::new("$($ex.Exception.InnerException.Response.StatusCode, $ex.Exception.InnerException.Response.StatusDescription)$strResponse ", $ex.Exception.InnerException
376376
), $ex.Exception.HResult, 'NotSpecified', $webRequest)
377377
)
378378
return

0 commit comments

Comments
 (0)