fixed error logging

This commit is contained in:
2026-03-27 13:24:59 -07:00
parent ae29dbab8b
commit 84e2a4132e

View File

@@ -71,7 +71,10 @@ try {
return $true
}
catch {
Write-Host "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') [ERROR] Save failed: $_"
$inner = $_.Exception.InnerException
while ($inner.InnerException) { $inner = $inner.InnerException }
$msg = if ($inner) { $inner.Message } else { $_.Exception.Message }
Write-Host "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') [ERROR] Save failed: $msg"
return $false
}
finally {