use thiserror::Error;
use crate::{
error::LibraryError, extensions::errors::InvalidExtensionError,
treesync::errors::TreeSyncFromNodesError,
};
#[derive(Error, Debug, PartialEq, Clone)]
pub enum CreationFromExternalError {
#[error(transparent)]
LibraryError(#[from] LibraryError),
#[error(transparent)]
TreeSyncError(#[from] TreeSyncFromNodesError),
#[error("Sender not found in tree.")]
UnknownSender,
#[error("The signature on the GroupInfo is not valid.")]
InvalidGroupInfoSignature,
#[error("The computed tree hash does not match the one in the GroupInfo.")]
TreeHashMismatch,
#[error("We don't support the version of the group we are trying to join.")]
UnsupportedMlsVersion,
}
#[derive(Error, Debug, PartialEq, Clone)]
pub enum PublicGroupBuildError {
#[error(transparent)]
LibraryError(#[from] LibraryError),
#[error("Unsupported proposal type in required capabilities.")]
UnsupportedProposalType,
#[error("Unsupported extension type in required capabilities.")]
UnsupportedExtensionType,
#[error("Invalid extensions set in configuration")]
InvalidExtensions(#[from] InvalidExtensionError),
}