openmls/targeted_messages/
errors.rs1use thiserror::Error;
4
5use crate::error::LibraryError;
6
7#[derive(Debug, Error)]
9pub enum CreateTargetedMessageError {
10 #[error("The recipient is not a member of the group.")]
12 RecipientNotFound,
13 #[error("The group is not in an active state.")]
15 GroupNotActive,
16 #[error(transparent)]
18 LibraryError(#[from] LibraryError),
19}
20
21#[derive(Debug, Error)]
23pub enum ProcessTargetedMessageError<StorageError> {
24 #[error("The group ID in the targeted message does not match.")]
26 GroupIdMismatch,
27 #[error("The epoch in the targeted message does not match.")]
29 EpochMismatch,
30 #[error("The recipient leaf index does not match own leaf index.")]
32 NotIntendedRecipient,
33 #[error("The sender's leaf index refers to a blank or missing leaf.")]
35 SenderNotFound,
36 #[error("Failed to decrypt sender authentication data.")]
38 SenderAuthDataDecryptionFailed,
39 #[error("Malformed sender authentication data.")]
41 MalformedSenderAuthData,
42 #[error("Signature verification on targeted message failed.")]
44 SignatureVerificationFailed,
45 #[error("Failed to decrypt targeted message content.")]
47 ContentDecryptionFailed,
48 #[error("Malformed targeted message content.")]
50 MalformedContent,
51 #[error("The group is not in an active state.")]
53 GroupNotActive,
54 #[error("Error reading from storage: {0}")]
56 StorageError(StorageError),
57 #[error(transparent)]
59 LibraryError(#[from] LibraryError),
60}