From 1d6399d7f4649472333da946669ce9f1fa349b89 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sun, 5 Nov 2023 18:17:11 +0100 Subject: Cleanup, fixes, fix proxy support --- LibMatrix/MatrixException.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'LibMatrix/MatrixException.cs') diff --git a/LibMatrix/MatrixException.cs b/LibMatrix/MatrixException.cs index 3aaad19..f127abf 100644 --- a/LibMatrix/MatrixException.cs +++ b/LibMatrix/MatrixException.cs @@ -17,6 +17,9 @@ public class MatrixException : Exception { public int? RetryAfterMs { get; set; } public string RawContent { get; set; } + + public string? GetAsJson() => new { ErrorCode, Error, SoftLogout, RetryAfterMs }.ToJson(ignoreNull: true); + public override string Message => $"{ErrorCode}: {ErrorCode switch { -- cgit 1.4.1