Skip to content

Commit 478d8f3

Browse files
committed
Fixes exception output not properly constructed
1 parent 5530a84 commit 478d8f3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/icinga/exception/Exit-IcingaThrowException.psm1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ function Exit-IcingaThrowException()
5252
[string]$ExceptionName = '';
5353
[string]$ExceptionIWKB = $KnowledgeBaseId;
5454

55-
if ($ExceptionThrown -is [hashtable]) {
56-
$ExceptionIWKB = $ExceptionThrown.IWKB;
57-
$ExceptionThrown = $ExceptionThrown.Message;
58-
}
59-
6055
if ($null -ne $ExceptionMessageLib) {
6156
foreach ($definedError in $ExceptionMessageLib.Keys) {
6257
if ($ExceptionMessageLib.$definedError -eq $ExceptionThrown) {
@@ -74,6 +69,11 @@ function Exit-IcingaThrowException()
7469
);
7570
}
7671

72+
if ($ExceptionThrown -is [hashtable]) {
73+
$ExceptionIWKB = $ExceptionThrown.IWKB;
74+
$ExceptionThrown = $ExceptionThrown.Message;
75+
}
76+
7777
if ([string]::IsNullOrEmpty($ExceptionIWKB) -eq $FALSE) {
7878
$ExceptionIWKB = [string]::Format(
7979
'{0}{0}Further details can be found on the Icinga for Windows Knowledge base: https://icinga.com/docs/windows/latest/doc/knowledgebase/{1}',

0 commit comments

Comments
 (0)