Skip to content

Commit f955b81

Browse files
Add logging in trap
1 parent 0e9038c commit f955b81

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

src/dsc/psresourceget.ps1

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,18 @@ function ConvertInputToPSResource(
274274

275275
# catch any un-caught exception and write it to the error stream
276276
trap {
277-
Write-Trace -Level Error -message $_.Exception.Message
278-
exit 1
277+
# Write-Trace -Level Error -message $_.Exception.Message
278+
# exit 1
279+
280+
$e = $_.Exception
281+
282+
while ($e) {
283+
"-----"
284+
$e.GetType().FullName
285+
$e.Message
286+
$e = $e.InnerException
287+
}
288+
279289
}
280290

281291
function GetPSResourceList {
@@ -512,7 +522,7 @@ function ExportOperation {
512522
}
513523

514524
'repositorylist' {
515-
Write-Trace -level error -message "Get operation is not implemented for RepositoryList resource."
525+
Write-Trace -level error -message "Export operation is not implemented for RepositoryList resource."
516526
exit 8
517527
}
518528
'psresource' {

0 commit comments

Comments
 (0)