From 4dc454403b640d8bb1cf259ca8791881117d7f5a Mon Sep 17 00:00:00 2001 From: pitzm Date: Thu, 3 Sep 2026 15:04:44 +0200 Subject: [PATCH] =?UTF-8?q?Modules.Interfaces:=20Log-Meldungen=20erg=C3=A4?= =?UTF-8?q?nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Interfaces/ZUGFeRDInterface.vb | 6 ++++++ Interfaces/ZUGFeRDInterface/Validator.vb | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/Interfaces/ZUGFeRDInterface.vb b/Interfaces/ZUGFeRDInterface.vb index 603cf7e4..f88bdf26 100644 --- a/Interfaces/ZUGFeRDInterface.vb +++ b/Interfaces/ZUGFeRDInterface.vb @@ -196,6 +196,12 @@ Public Class ZUGFeRDInterface oResult = _Validator.ValidateZUGFeRDDocument(oResult) + If oResult.ValidationErrors.Count > 0 Then + _logger.Warn($"XML-Logik - Nach Validator() Errors: {oResult.ValidationErrors.Count}") + Else + _logger.Info($"XML-Logik - Nach Validator() NO Errors.") + End If + Catch ex As ZUGFeRDExecption ' Don't log ZUGFeRD Exceptions here, they should be handled by the calling code. ' It also produces misleading error messages when checking if an attachment is a zugferd file. diff --git a/Interfaces/ZUGFeRDInterface/Validator.vb b/Interfaces/ZUGFeRDInterface/Validator.vb index 29e9e643..4219056e 100644 --- a/Interfaces/ZUGFeRDInterface/Validator.vb +++ b/Interfaces/ZUGFeRDInterface/Validator.vb @@ -26,6 +26,7 @@ Public Class Validator For Each oNode As XElement In oDecimalNodes Dim oParsedValue As Decimal = 0.0 If Decimal.TryParse(oNode.Value, oParsedValue) = False Then + _logger.Warn($"Invalid Decimal Value in {oNode.Name.LocalName}") pResult.ValidationErrors.Add(New ZugferdValidationError() With { .ElementName = oNode.Name.LocalName, .ElementValue = oNode.Value, @@ -50,6 +51,8 @@ Public Class Validator For Each oNode As XElement In oCurrencyCodeNodes Dim oValid = ValidateCurrencyCode(oNode.Value) If oValid = False Then + _logger.Warn($"Invalid CurrencyCode in {oNode.Name.LocalName}") + pResult.ValidationErrors.Add(New ZugferdValidationError() With { .ElementName = oNode.Name.LocalName, .ElementValue = oNode.Value, @@ -78,6 +81,7 @@ Public Class Validator Dim oValid = ValidateCurrencyCode(oCurrencyID) If oValid = False Then + _logger.Warn($"Invalid CurrencyID in {oNode.Name.LocalName}") pResult.ValidationErrors.Add(New ZugferdValidationError() With { .ElementName = oNode.Name.LocalName, .ElementValue = oCurrencyID,