1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum Error {
6 #[error("sender must have an encryption key")]
8 SenderMissingEncryptionKey,
9
10 #[error("recipient must have an encryption key")]
12 RecipientMissingEncryptionKey,
13
14 #[error("sender must have a verification key")]
16 SenderMissingVerificationKey,
17
18 #[error("continuation expired")]
20 ContinuationExpired,
21
22 #[error("continuation ID invalid")]
24 ContinuationIdInvalid,
25
26 #[error("peer continuation must be encrypted")]
28 PeerContinuationNotEncrypted,
29
30 #[error("requests must contain a peer continuation")]
32 MissingPeerContinuation,
33
34 #[error(transparent)]
36 Envelope(#[from] bc_envelope::Error),
37
38 #[error(transparent)]
40 XID(#[from] bc_xid::Error),
41}
42
43pub type Result<T> = std::result::Result<T, Error>;