fixed error logging
This commit is contained in:
@@ -71,7 +71,10 @@ try {
|
|||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
catch {
|
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
|
return $false
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user