openmls/group/public_group/
errors.rsuse thiserror::Error;
use crate::{
error::LibraryError,
extensions::errors::InvalidExtensionError,
treesync::errors::{LeafNodeValidationError, TreeSyncFromNodesError},
};
#[derive(Error, Debug, PartialEq, Clone)]
pub enum CreationFromExternalError<StorageError> {
#[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,
#[error(transparent)]
LeafNodeValidation(#[from] LeafNodeValidationError),
#[error("Error writing to storage: {0}")]
WriteToStorageError(StorageError),
#[error("A parent node has an unmerged leaf that is not a descendant of the node")]
UnmergedLeafNotADescendant,
#[error("Found a path from a parent with an unmerged leaf to the leaf with nodes that do not have that as a leaf")]
IntermediateNodeMissingUnmergedLeaf,
#[error("The ratchet tree contains duplcate encryption keys")]
DuplicateEncryptionKey,
}
#[derive(Error, Debug, PartialEq, Clone)]
pub enum PublicGroupBuildError {
#[error(transparent)]
LibraryError(#[from] LibraryError),
#[error("Invalid extensions set in configuration")]
InvalidExtensions(#[from] InvalidExtensionError),
}