openmls/group/public_group/
errors.rs1use thiserror::Error;
2
3use crate::{
4 error::LibraryError,
5 extensions::errors::InvalidExtensionError,
6 treesync::errors::{LeafNodeValidationError, TreeSyncFromNodesError},
7};
8
9#[derive(Error, Debug, PartialEq, Clone)]
11pub enum CreationFromExternalError<StorageError> {
12 #[error(transparent)]
14 LibraryError(#[from] LibraryError),
15 #[error(transparent)]
17 TreeSyncError(#[from] TreeSyncFromNodesError),
18 #[error("Sender not found in tree.")]
20 UnknownSender,
21 #[error("The signature on the GroupInfo is not valid.")]
23 InvalidGroupInfoSignature,
24 #[error("The computed tree hash does not match the one in the GroupInfo.")]
26 TreeHashMismatch,
27 #[error("We don't support the version of the group we are trying to join.")]
29 UnsupportedMlsVersion,
30 #[error(transparent)]
32 LeafNodeValidation(#[from] LeafNodeValidationError),
33 #[error("Error writing to storage: {0}")]
35 WriteToStorageError(StorageError),
36 #[error("A parent node has an unmerged leaf that is not a descendant of the node")]
38 UnmergedLeafNotADescendant,
39 #[error("Found a path from a parent with an unmerged leaf to the leaf with nodes that do not have that as a leaf")]
41 IntermediateNodeMissingUnmergedLeaf,
42 #[error("The ratchet tree contains duplcate encryption keys")]
44 DuplicateEncryptionKey,
45}
46
47#[derive(Error, Debug, PartialEq, Clone)]
49pub enum PublicGroupBuildError {
50 #[error(transparent)]
52 LibraryError(#[from] LibraryError),
53 #[error("Invalid extensions set in configuration")]
55 InvalidExtensions(#[from] InvalidExtensionError),
56}