From 1beca653b772cf10586c417b2c25df03a67df8a2 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Mon, 17 Jul 2023 00:21:24 +0200 Subject: Handle external logouts --- MatrixRoomUtils.Core/Extensions/HttpClientExtensions.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'MatrixRoomUtils.Core/Extensions') diff --git a/MatrixRoomUtils.Core/Extensions/HttpClientExtensions.cs b/MatrixRoomUtils.Core/Extensions/HttpClientExtensions.cs index 060867d..695e8e3 100644 --- a/MatrixRoomUtils.Core/Extensions/HttpClientExtensions.cs +++ b/MatrixRoomUtils.Core/Extensions/HttpClientExtensions.cs @@ -40,6 +40,7 @@ public class MatrixHttpClient : HttpClient { var content = await a.Content.ReadAsStringAsync(cancellationToken); if (content.StartsWith('{')) { var ex = JsonSerializer.Deserialize(content); + ex.RawContent = content; Console.WriteLine($"Failed to send request: {ex}"); if (ex?.RetryAfterMs is not null) { await Task.Delay(ex.RetryAfterMs.Value, cancellationToken); @@ -61,4 +62,4 @@ public class MatrixHttpClient : HttpClient { await using var responseStream = await response.Content.ReadAsStreamAsync(cancellationToken); return await JsonSerializer.DeserializeAsync(responseStream, cancellationToken: cancellationToken); } -} \ No newline at end of file +} -- cgit 1.5.1