feat(EConnectClient): Logik hinzufügen, um zu behandeln, wenn bei einem Fehler kein Inhalt vorhanden ist

This commit is contained in:
tekh 2025-08-18 11:03:28 +02:00
parent 21cc348c6c
commit 060ba64268

View File

@ -132,7 +132,9 @@ public class EConnectClient<TError> : IEConnectClient<TError> where TError : cl
}
else
{
var error = await res.Content.ReadFromJsonAsync<TError>(_options.JsonSerializerOptions, cancel);
TError? error = null;
if (res.Content.Headers.ContentLength > 0)
error = await res.Content.ReadFromJsonAsync<TError>(_options.JsonSerializerOptions, cancel);
return new()
{
Ok = false,