From cad5e81c6801006f043057f5f3e45339c7402c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sun, 12 Jun 2022 14:02:34 +0200 Subject: [PATCH] client-api: Add error kinds encountered for restricted rooms According to MSC3083 --- crates/ruma-client-api/CHANGELOG.md | 1 + crates/ruma-client-api/src/error.rs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/crates/ruma-client-api/CHANGELOG.md b/crates/ruma-client-api/CHANGELOG.md index 8bd36ae5..4a2f3f6a 100644 --- a/crates/ruma-client-api/CHANGELOG.md +++ b/crates/ruma-client-api/CHANGELOG.md @@ -9,6 +9,7 @@ Breaking changes: Improvements: * Add unstable support for refresh tokens (MSC2918) +* Add `ErrorKind::{UnableToAuthorizeJoin, UnableToGrantJoin}` encountered for restricted rooms # 0.14.1 diff --git a/crates/ruma-client-api/src/error.rs b/crates/ruma-client-api/src/error.rs index 0b820382..a5df64a3 100644 --- a/crates/ruma-client-api/src/error.rs +++ b/crates/ruma-client-api/src/error.rs @@ -141,6 +141,12 @@ pub enum ErrorKind { /// M_WEAK_PASSWORD WeakPassword, + /// M_UNABLE_TO_AUTHORISE_JOIN + UnableToAuthorizeJoin, + + /// M_UNABLE_TO_GRANT_JOIN + UnableToGrantJoin, + /// FI.MAU.MSC2246_NOT_YET_UPLOADED #[cfg(feature = "unstable-msc2246")] NotYetUploaded, @@ -193,6 +199,8 @@ impl AsRef for ErrorKind { Self::ResourceLimitExceeded { .. } => "M_RESOURCE_LIMIT_EXCEEDED", Self::CannotLeaveServerNoticeRoom => "M_CANNOT_LEAVE_SERVER_NOTICE_ROOM", Self::WeakPassword => "M_WEAK_PASSWORD", + Self::UnableToAuthorizeJoin => "M_UNABLE_TO_AUTHORISE_JOIN", + Self::UnableToGrantJoin => "M_UNABLE_TO_GRANT_JOIN", #[cfg(feature = "unstable-msc2246")] Self::NotYetUploaded => "FI.MAU.MSC2246_NOT_YET_UPLOADED", #[cfg(feature = "unstable-msc2246")]