diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-08-14 19:45:52 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-08-14 19:45:52 +0200 |
commit | 8253ca8cb96154f95854b1c1e5dd3ba53f41e5ec (patch) | |
tree | 34976d3e005f91ba479ce8286a9ffa6ac9651237 /MxApiExtensions/MatrixException.cs | |
parent | Initial commit (diff) | |
download | MxApiExtensions-8253ca8cb96154f95854b1c1e5dd3ba53f41e5ec.tar.xz |
Code cleanup
Diffstat (limited to 'MxApiExtensions/MatrixException.cs')
-rw-r--r-- | MxApiExtensions/MatrixException.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/MxApiExtensions/MatrixException.cs b/MxApiExtensions/MatrixException.cs index 1daf5d1..568c5a9 100644 --- a/MxApiExtensions/MatrixException.cs +++ b/MxApiExtensions/MatrixException.cs @@ -21,9 +21,10 @@ public class MatrixException : Exception { //turn this into json public JsonObject GetAsJson() { - var jsonObject = new JsonObject(); - jsonObject["errcode"] = ErrorCode; - jsonObject["error"] = Error; + var jsonObject = new JsonObject { + ["errcode"] = ErrorCode, + ["error"] = Error + }; if(SoftLogout is not null) jsonObject["soft_logout"] = SoftLogout; if(RetryAfterMs is not null) jsonObject["retry_after_ms"] = RetryAfterMs; return jsonObject; |