From f3afadc3b7c60b79d420cdbe5f7edbb0b72c1703 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 28 Feb 2023 14:56:01 +0100 Subject: [PATCH] Interfaces: fix Zugferd exceptions --- Interfaces/ZUGFeRDInterface.vb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Interfaces/ZUGFeRDInterface.vb b/Interfaces/ZUGFeRDInterface.vb index 75c4bc15..ab62b7e4 100644 --- a/Interfaces/ZUGFeRDInterface.vb +++ b/Interfaces/ZUGFeRDInterface.vb @@ -311,7 +311,8 @@ Public Class ZUGFeRDInterface Next If oObject Is Nothing Then - Throw New ApplicationException("No Types matched the given document. Document could not be serialized.") + 'Throw New ApplicationException("No Types matched the given document. Document could not be serialized.") + Throw New ZUGFeRDExecption(ErrorType.UnsupportedFormat, "Unsupported Format") End If pResult.Specification = oSpecification @@ -319,6 +320,10 @@ Public Class ZUGFeRDInterface Return pResult + Catch ex As ZUGFeRDExecption + _logger.Error(ex) + Throw ex + Catch ex As Exception _logger.Error(ex) Dim oMessage = "Datei ist eine ungültige ZUGFeRD Datei oder das Format wird nicht unterstüzt, oder das Format ist deaktiviert."