1use crate::mls_crypto;
4
5#[derive(Debug, thiserror::Error)]
6pub enum CoreError {
7 #[error("MLS error: {0}")]
9 Mls(#[from] mls_crypto::MlsError),
10
11 #[error("Consensus error: {0}")]
12 ConsensusError(#[from] hashgraph_like_consensus::error::ConsensusError),
13
14 #[error("System time error: {0}")]
15 SystemTimeError(#[from] std::time::SystemTimeError),
16
17 #[error("Message error: {0}")]
19 MessageError(#[from] prost::DecodeError),
20
21 #[error("MLS group not initialized")]
23 MlsGroupNotInitialized,
24
25 #[error("caller is not a steward")]
27 NotASteward,
28
29 #[error("No proposals available")]
31 NoProposals,
32
33 #[error("Invalid conversation update request")]
34 InvalidConversationUpdateRequest,
35
36 #[error("Invalid subtopic: {0}")]
37 InvalidSubtopic(String),
38
39 #[error("Empty members list")]
40 EmptyMembersList,
41
42 #[error("Invalid config size")]
43 InvalidConfigSize,
44
45 #[error(
49 "Non-MLS proposals found in approved queue (ids: {proposal_ids:?}). \
50 They should have been removed by apply_consensus_result."
51 )]
52 UnexpectedNonMlsProposals { proposal_ids: Vec<u32> },
53}