about summary refs log tree commit diff
path: root/LibMatrix/MatrixException.cs
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-11-05 18:17:11 +0100
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-11-05 18:17:11 +0100
commit1d6399d7f4649472333da946669ce9f1fa349b89 (patch)
tree95baedad8e42956de6d4d339d5c4fdc44ae2396b /LibMatrix/MatrixException.cs
parentsplit client and server http client for homeservers (diff)
downloadLibMatrix-1d6399d7f4649472333da946669ce9f1fa349b89.tar.xz
Cleanup, fixes, fix proxy support
Diffstat (limited to 'LibMatrix/MatrixException.cs')
-rw-r--r--LibMatrix/MatrixException.cs3
1 files changed, 3 insertions, 0 deletions
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 {