Add M_WEAK_PASSWORD error code to ruma-client-api

This commit is contained in:
Andrej Kacian 2022-01-17 00:27:14 +01:00 committed by Jonas Platte
parent 08d60b3d37
commit e4a21580a2
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
2 changed files with 6 additions and 0 deletions

View File

@ -136,6 +136,9 @@ pub enum ErrorKind {
/// M_CANNOT_LEAVE_SERVER_NOTICE_ROOM /// M_CANNOT_LEAVE_SERVER_NOTICE_ROOM
CannotLeaveServerNoticeRoom, CannotLeaveServerNoticeRoom,
/// M_WEAK_PASSWORD
WeakPassword,
#[doc(hidden)] #[doc(hidden)]
_Custom { errcode: PrivOwnedStr, extra: Extra }, _Custom { errcode: PrivOwnedStr, extra: Extra },
} }
@ -179,6 +182,7 @@ impl AsRef<str> for ErrorKind {
Self::Exclusive => "M_EXCLUSIVE", Self::Exclusive => "M_EXCLUSIVE",
Self::ResourceLimitExceeded { .. } => "M_RESOURCE_LIMIT_EXCEEDED", Self::ResourceLimitExceeded { .. } => "M_RESOURCE_LIMIT_EXCEEDED",
Self::CannotLeaveServerNoticeRoom => "M_CANNOT_LEAVE_SERVER_NOTICE_ROOM", Self::CannotLeaveServerNoticeRoom => "M_CANNOT_LEAVE_SERVER_NOTICE_ROOM",
Self::WeakPassword => "M_WEAK_PASSWORD",
Self::_Custom { errcode, .. } => &errcode.0, Self::_Custom { errcode, .. } => &errcode.0,
} }
} }

View File

@ -206,6 +206,7 @@ impl<'de> Visitor<'de> for ErrorKindVisitor {
.map_err(de::Error::custom)?, .map_err(de::Error::custom)?,
}, },
ErrCode::CannotLeaveServerNoticeRoom => ErrorKind::CannotLeaveServerNoticeRoom, ErrCode::CannotLeaveServerNoticeRoom => ErrorKind::CannotLeaveServerNoticeRoom,
ErrCode::WeakPassword => ErrorKind::WeakPassword,
ErrCode::_Custom(errcode) => ErrorKind::_Custom { errcode, extra }, ErrCode::_Custom(errcode) => ErrorKind::_Custom { errcode, extra },
}) })
} }
@ -246,6 +247,7 @@ enum ErrCode {
Exclusive, Exclusive,
ResourceLimitExceeded, ResourceLimitExceeded,
CannotLeaveServerNoticeRoom, CannotLeaveServerNoticeRoom,
WeakPassword,
_Custom(PrivOwnedStr), _Custom(PrivOwnedStr),
} }