Skip to content

Commit 46124ab

Browse files
committed
Change so the error is at the end
1 parent 3b8bcc2 commit 46124ab

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Users/Invoke-ExecRestoreDeleted.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ Function Invoke-ExecRestoreDeleted {
3030
$StatusCode = [HttpStatusCode]::OK
3131
} catch {
3232
$ErrorMessage = Get-CippException -Exception $_
33-
$Result = "Failed to restore deleted item with ID: '$($RequestID)'. Error: $($ErrorMessage.NormalizedError)"
33+
$Result = "Failed to restore deleted item with ID: '$($RequestID)'"
3434
if ($UserPrincipalName) { $Result += " User Principal Name: '$($UserPrincipalName)'" }
3535
if ($DisplayName) { $Result += " Display Name: '$($DisplayName)'" }
36+
$Result += " Error: $($ErrorMessage.NormalizedError)"
3637

3738
Write-LogMessage -headers $Headers -tenant $TenantFilter -API $APIName -message $Result -Sev 'Error' -LogData $ErrorMessage
3839
$StatusCode = [HttpStatusCode]::InternalServerError

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Users/Invoke-RemoveDeletedObject.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ Function Invoke-RemoveDeletedObject {
3030
$StatusCode = [HttpStatusCode]::OK
3131
} catch {
3232
$ErrorMessage = Get-CippException -Exception $_
33-
$Result = "Failed to permanently delete item with ID: $($RequestID). Error: $($ErrorMessage.NormalizedError)"
33+
$Result = "Failed to permanently delete item with ID: $($RequestID)"
3434
if ($UserPrincipalName) { $Result += " User Principal Name: '$($UserPrincipalName)'" }
3535
if ($DisplayName) { $Result += " Display Name: '$($DisplayName)'" }
36+
$Result += " Error: $($ErrorMessage.NormalizedError)"
3637

3738
Write-LogMessage -headers $Headers -tenant $TenantFilter -API $APIName -message $Result -Sev 'Error' -LogData $ErrorMessage
3839
$StatusCode = [HttpStatusCode]::InternalServerError

0 commit comments

Comments
 (0)