about summary refs log tree commit diff
path: root/MatrixRoomUtils.Core/Extensions
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-07-17 00:21:24 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-07-17 00:21:24 +0200
commit1beca653b772cf10586c417b2c25df03a67df8a2 (patch)
treed539b5f329cb62f253e1bc8142c3a313719657b0 /MatrixRoomUtils.Core/Extensions
parentChanges (diff)
downloadMatrixUtils-1beca653b772cf10586c417b2c25df03a67df8a2.tar.xz
Handle external logouts
Diffstat (limited to 'MatrixRoomUtils.Core/Extensions')
-rw-r--r--MatrixRoomUtils.Core/Extensions/HttpClientExtensions.cs3
1 files changed, 2 insertions, 1 deletions
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<MatrixException>(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<T>(responseStream, cancellationToken: cancellationToken); } -} \ No newline at end of file +}