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 #[error("The ratchet tree contains duplcate signature keys")]
47 DuplicateSignatureKey,
48}
49
50#[derive(Error, Debug, PartialEq, Clone)]
52pub enum PublicGroupBuildError {
53 #[error(transparent)]
55 LibraryError(#[from] LibraryError),
56 #[error("Invalid extensions set in configuration")]
58 InvalidExtensions(#[from] InvalidExtensionError),
59}
60
61#[cfg(feature = "extensions-draft-08")]
63#[derive(Error, Debug, PartialEq, Clone)]
64pub enum ApplyAppDataUpdateError {
65 #[error("Found AppDataUpdate proposals, but was not provided the updated values")]
67 MissingAppDataUpdates,
68 #[error("No AppDataUpdate proposals found, but was provided updated values")]
70 SuperfluousAppDataUpdates,
71 #[error(transparent)]
73 LibraryError(#[from] LibraryError),
74}