Skip to content

Commit b29b450

Browse files
committed
add http status code to schematron validation
1 parent 4bbd7c8 commit b29b450

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/pax.XRechnung.NET/InvoiceValidationResult.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ public InvoiceValidationResult(ICollection<ValidationEventArgs> validationEventA
2727
}
2828
}
2929
/// <summary>
30+
/// HttpStatusCode
31+
/// </summary>
32+
public string HttpStatusCode { get; set; } = string.Empty;
33+
/// <summary>
3034
/// Constructor
3135
/// </summary>
3236
/// <param name="validationMessages"></param>

src/pax.XRechnung.NET/XmlInvoiceVlidator.Schematron.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,12 @@ private static InvoiceValidationResult MapToValidationResult(SchematronValidatio
8282

8383
if (!string.IsNullOrEmpty(kositResult.Error) || !kositResult.IsValid)
8484
{
85-
validationEvents.Add(new(new XmlSchemaException("xml invalid"), kositResult.Error ?? "Unexpected error.", XmlSeverityType.Error));
85+
validationEvents.Add(new(new XmlSchemaException("unknown"), kositResult.Error ?? kositResult.HttpStatusCode.ToString(), XmlSeverityType.Error));
8686
}
8787

8888
var result = new InvoiceValidationResult(validationEvents)
8989
{
90+
HttpStatusCode = kositResult.HttpStatusCode.ToString(),
9091
Evaluation = kositResult.Evaluation,
9192
Conformity = kositResult.Conformity
9293
};

0 commit comments

Comments
 (0)