Co-authored-by: Mona Hmiza <you@example.com>
This commit is contained in:
RavMorgan
2024-03-30 19:22:13 +03:00
committed by GitHub
parent 608df5a713
commit 741eb8bbf5

View File

@@ -313,13 +313,15 @@ public sealed class GlobalPlayTimeTrackingManager : IPlayTimeTrackingManager
List<PlayTimeDto>? playTimes = null!; List<PlayTimeDto>? playTimes = null!;
var content = await response.Content.ReadAsStringAsync(cancel);
try try
{ {
playTimes = await response.Content.ReadFromJsonAsync<List<PlayTimeDto>>(); playTimes = JsonSerializer.Deserialize<List<PlayTimeDto>>(content);
} }
catch (JsonException) catch (JsonException)
{ {
_sawmill.Error($"Can't load data for user {session.Name} with UserId {session.UserId}"); _sawmill.Error($"Can't load data for user {session.Name} with UserId {session.UserId} \n Data: {content}");
} }
cancel.ThrowIfCancellationRequested(); cancel.ThrowIfCancellationRequested();