openmls/framing/
errors.rs1use crate::error::LibraryError;
6use thiserror::Error;
7
8pub use crate::tree::secret_tree::SecretTreeError;
12
13#[derive(Error, Debug, PartialEq, Clone)]
15pub enum MessageDecryptionError {
16 #[error(transparent)]
18 LibraryError(#[from] LibraryError),
19 #[error("Couldn't find a ratcheting secret for the given sender and generation.")]
21 GenerationOutOfBound,
22 #[error("An error occurred during AEAD decryption.")]
24 AeadError,
25 #[error("The WireFormat was not PrivateMessage.")]
27 WrongWireFormat,
28 #[error("The content is malformed.")]
30 MalformedContent,
31 #[error(transparent)]
33 SecretTreeError(#[from] SecretTreeError),
34 #[cfg(feature = "virtual-clients-draft")]
36 #[error(transparent)]
37 VirtualClientsError(#[from] crate::components::vc_derivation_info::VirtualClientsError),
38}
39
40#[derive(Error, Debug, PartialEq, Clone)]
42pub enum MessageEncryptionError<StorageError> {
43 #[error(transparent)]
45 LibraryError(#[from] LibraryError),
46 #[error("The WireFormat was not PrivateMessage.")]
48 WrongWireFormat,
49 #[error(transparent)]
51 SecretTreeError(#[from] SecretTreeError),
52 #[error("Error reading from or writing to storage: {0}")]
54 StorageError(StorageError),
55 #[cfg(feature = "virtual-clients-draft")]
57 #[error(transparent)]
58 VirtualClientsError(#[from] crate::components::vc_derivation_info::VirtualClientsError),
59}
60
61#[derive(Error, Debug, Clone)]
63pub enum MlsMessageError {
64 #[error("The message could not be decoded.")]
66 UnableToDecode,
67 #[error("The message (or one of its parts) is too large to be encoded.")]
69 UnableToEncode,
70}
71
72#[derive(Error, Debug, Clone)]
74pub enum ProtocolMessageError {
75 #[error("Wrong wire format")]
77 WrongWireFormat,
78}