Skip to content

Commit 3a12077

Browse files
Merge branch 'dev' of https://github.com/CyberDrain/CIPP into dev
Synced from CyberDrain/CIPP@96cbd11
1 parent 417fc28 commit 3a12077

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

Modules/CIPPCore/Public/GraphHelper/Get-CippException.ps1

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ function Get-CippException {
55
)
66

77
[PSCustomObject]@{
8-
Message = $Exception.Exception.Message
9-
NormalizedError = Get-NormalizedError -message $Exception.Exception.Message
10-
Position = $Exception.InvocationInfo.PositionMessage
11-
StackTrace = ($Exception.ScriptStackTrace | Out-String)
12-
ScriptName = $Exception.InvocationInfo.ScriptName
13-
LineNumber = $Exception.InvocationInfo.ScriptLineNumber
14-
Category = $Exception.CategoryInfo.ToString()
8+
Message = $Exception.Exception.Message ?? 'Not available'
9+
NormalizedError = (Get-NormalizedError -message $Exception.Exception.Message) ?? 'Not available'
10+
RawError = ($Exception.Exception.Data['RawErrorBody'] ?? $Exception.ErrorDetails.Message ?? $Exception.Exception.Response.Content) ?? 'Not available'
11+
Position = $Exception.InvocationInfo.PositionMessage ?? 'Not available'
12+
StackTrace = ($Exception.ScriptStackTrace | Out-String) ?? 'Not available'
13+
ScriptName = $Exception.InvocationInfo.ScriptName ?? 'Not available'
14+
LineNumber = $Exception.InvocationInfo.ScriptLineNumber ?? 'Not available'
15+
Category = ($Exception.CategoryInfo.ToString()) ?? 'Not available'
1516
}
1617
}

0 commit comments

Comments
 (0)