mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Fixes exception output not properly constructed
This commit is contained in:
parent
5530a84acd
commit
478d8f3566
1 changed files with 5 additions and 5 deletions
|
|
@ -52,11 +52,6 @@ function Exit-IcingaThrowException()
|
||||||
[string]$ExceptionName = '';
|
[string]$ExceptionName = '';
|
||||||
[string]$ExceptionIWKB = $KnowledgeBaseId;
|
[string]$ExceptionIWKB = $KnowledgeBaseId;
|
||||||
|
|
||||||
if ($ExceptionThrown -is [hashtable]) {
|
|
||||||
$ExceptionIWKB = $ExceptionThrown.IWKB;
|
|
||||||
$ExceptionThrown = $ExceptionThrown.Message;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($null -ne $ExceptionMessageLib) {
|
if ($null -ne $ExceptionMessageLib) {
|
||||||
foreach ($definedError in $ExceptionMessageLib.Keys) {
|
foreach ($definedError in $ExceptionMessageLib.Keys) {
|
||||||
if ($ExceptionMessageLib.$definedError -eq $ExceptionThrown) {
|
if ($ExceptionMessageLib.$definedError -eq $ExceptionThrown) {
|
||||||
|
|
@ -74,6 +69,11 @@ function Exit-IcingaThrowException()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($ExceptionThrown -is [hashtable]) {
|
||||||
|
$ExceptionIWKB = $ExceptionThrown.IWKB;
|
||||||
|
$ExceptionThrown = $ExceptionThrown.Message;
|
||||||
|
}
|
||||||
|
|
||||||
if ([string]::IsNullOrEmpty($ExceptionIWKB) -eq $FALSE) {
|
if ([string]::IsNullOrEmpty($ExceptionIWKB) -eq $FALSE) {
|
||||||
$ExceptionIWKB = [string]::Format(
|
$ExceptionIWKB = [string]::Format(
|
||||||
'{0}{0}Further details can be found on the Icinga for Windows Knowledge base: https://icinga.com/docs/windows/latest/doc/knowledgebase/{1}',
|
'{0}{0}Further details can be found on the Icinga for Windows Knowledge base: https://icinga.com/docs/windows/latest/doc/knowledgebase/{1}',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue