pleroma groups!!!!!! try it -> https://piggo.space/hob
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
group-actor/src/error.rs

38 lines
1.1 KiB

use std::borrow::Cow;
#[derive(Debug, Error)]
pub enum GroupError {
#[error("User is admin")]
UserIsAdmin,
#[error("User is banned")]
UserIsBanned,
#[error("User opted out from the group")]
UserOptedOut,
#[error("Server could not be banned because there are admin users on it")]
AdminsOnServer,
#[error("Config error: {0}")]
BadConfig(Cow<'static, str>),
#[error("API request timed out")]
ApiTimeout,
#[error(transparent)]
IoError(#[from] std::io::Error),
#[error(transparent)]
Serializer(#[from] serde_json::Error),
#[error(transparent)]
Serializer5(#[from] json5::Error),
#[error(transparent)]
Elefren(#[from] elefren::Error),
}
// this is for tests
impl PartialEq for GroupError {
fn eq(&self, other: &Self) -> bool {
matches!(
(self, other),
(Self::UserIsAdmin, Self::UserIsAdmin)
| (Self::UserIsBanned, Self::UserIsBanned)
| (Self::AdminsOnServer, Self::AdminsOnServer)
| (Self::BadConfig(_), Self::BadConfig(_))
)
}
}