about summary refs log tree commit diff
path: root/LibMatrix/MatrixException.cs
diff options
context:
space:
mode:
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 {