fix external API server error parsing

This commit is contained in:
Florian Förster 2025-04-30 16:24:47 +02:00
parent 6558d0818c
commit 725e323f98
2 changed files with 7 additions and 3 deletions

View File

@ -46,7 +46,7 @@ namespace dopt.DeltaBarth.Tests
Assert.AreEqual(102, parsed.code);
Assert.IsTrue(parsed.description.Contains("internal error occurred"));
Assert.AreEqual("caused by test", parsed.message);
Assert.IsNull(parsed.apiServerError);
Assert.IsNull(parsed.api_server_error);
PrettyPrint(parsed);
plugin.Dispose();
}
@ -151,7 +151,7 @@ namespace dopt.DeltaBarth.Tests
Assert.AreEqual(0, parsed.status.code);
Assert.AreEqual("Erfolg", parsed.status.description);
Assert.AreEqual("", parsed.status.message);
Assert.IsNull(parsed.status.apiServerError);
Assert.IsNull(parsed.status.api_server_error);
// check result
for (int i = 0; i < parsed.response.daten.Length; i++)
{

View File

@ -37,6 +37,10 @@ namespace dopt.DeltaBarth.DataObjects
/// </summary>
public string? title { get; init; }
/// <summary>
/// optional: zusätzliche Fehlerdetails, die vom Server ausgegeben wurden
/// </summary>
public Dictionary<string, List<string>>? errors { get; init; }
/// <summary>
/// optional: spezifischer ID (vermutlich zur Nachverfolgung) als Text, der vom Server ausgegeben wurde
/// </summary>
public string? traceId { get; init; }
@ -62,7 +66,7 @@ namespace dopt.DeltaBarth.DataObjects
/// <summary cref="ApiServerError">
/// optional: eventuell aufgetretener API-Server-Fehler
/// </summary>
public ApiServerError? apiServerError { get; init; }
public ApiServerError? api_server_error { get; init; }
}
/// <summary>