From 99e7a36d84d8f4cd445bd863dcdbe2d3f168e761 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 22 Apr 2020 10:47:09 +0200 Subject: [PATCH] Interfaces: Dont log ZUGFeRD Exceptions while validating, leads to misleading error messages --- Modules.Interfaces/ZUGFeRDInterface.vb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Modules.Interfaces/ZUGFeRDInterface.vb b/Modules.Interfaces/ZUGFeRDInterface.vb index 429f64cb..fa0df194 100644 --- a/Modules.Interfaces/ZUGFeRDInterface.vb +++ b/Modules.Interfaces/ZUGFeRDInterface.vb @@ -141,6 +141,10 @@ Public Class ZUGFeRDInterface Try Dim oResults = oAttachmentExtractor.Extract(Path, oAllowedExtensions) Return HandleAttachments(oResults) + 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. + Throw ex Catch ex As Exception _logger.Error(ex) Throw ex @@ -178,6 +182,10 @@ Public Class ZUGFeRDInterface End Using Return oXmlDocument + 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. + Throw ex Catch ex As Exception _logger.Error(ex) Throw ex