diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-11-05 18:17:11 +0100 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-11-05 18:17:11 +0100 |
commit | 1d6399d7f4649472333da946669ce9f1fa349b89 (patch) | |
tree | 95baedad8e42956de6d4d339d5c4fdc44ae2396b /LibMatrix/MatrixException.cs | |
parent | split client and server http client for homeservers (diff) | |
download | LibMatrix-1d6399d7f4649472333da946669ce9f1fa349b89.tar.xz |
Cleanup, fixes, fix proxy support
Diffstat (limited to 'LibMatrix/MatrixException.cs')
-rw-r--r-- | LibMatrix/MatrixException.cs | 3 |
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 { |