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}
35
36#[derive(Error, Debug, PartialEq, Clone)]
38pub(crate) enum MessageEncryptionError<StorageError> {
39 #[error(transparent)]
41 LibraryError(#[from] LibraryError),
42 #[error("The WireFormat was not PrivateMessage.")]
44 WrongWireFormat,
45 #[error(transparent)]
47 SecretTreeError(#[from] SecretTreeError),
48 #[error("Error reading from or writing to storage: {0}")]
50 StorageError(StorageError),
51}
52
53#[derive(Error, Debug, Clone)]
55pub enum MlsMessageError {
56 #[error("The message could not be decoded.")]
58 UnableToDecode,
59 #[error("The message (or one of its parts) is too large to be encoded.")]
61 UnableToEncode,
62}
63
64#[derive(Error, Debug, Clone)]
66pub enum ProtocolMessageError {
67 #[error("Wrong wire format")]
69 WrongWireFormat,
70}