error: add docstrings

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2022-09-30 17:10:52 +02:00
parent bcc2f7d85e
commit d94d472b9d
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -21,12 +21,19 @@ use xmpp_parsers::{Error as ParserError, FullJid, Jid};
#[derive(Debug)] #[derive(Debug)]
pub enum Error { pub enum Error {
/// Raised when editing an occupant with a non-matching session JID.
MismatchJids(Jid, Jid), MismatchJids(Jid, Jid),
/// Raised when a new occupant tries to use a nickname already assigned in the room.
NickAlreadyAssigned(String), NickAlreadyAssigned(String),
/// Raised when editing or fetching an occupant with a session that isn't associated with the
/// occupant.
NonexistantSession(FullJid), NonexistantSession(FullJid),
SessionAlreadyExists(FullJid), SessionAlreadyExists(FullJid),
/// Raised when fetching an occupant with a nickname that isn't assigned in the room.
ParticipantNotFound(String), ParticipantNotFound(String),
/// TokioXMPP errors
Xmpp(Box<TokioXMPPError>), Xmpp(Box<TokioXMPPError>),
/// Parser errors
Parser(Box<ParserError>), Parser(Box<ParserError>),
} }