1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use keri_core::{oobi::error::OobiError, prefix::IdentifierPrefix, transport::TransportError};

use crate::communication::SendingError;

use self::{broadcast::BroadcastingError, query_mailbox::ResponseProcessingError};

pub mod broadcast;
pub mod delegate;
pub mod group;
pub mod kel_managing;
mod mailbox;
pub mod notify_witness;
pub mod query_mailbox;
pub mod tel_managing;
pub mod watcher_configuration;

#[derive(Debug, thiserror::Error)]
pub enum MechanicsError {
    #[error(transparent)]
    SendingError(#[from] SendingError),

    #[error("Transport error: {0}")]
    Transport(#[from] TransportError),

    #[error("Can't lock")]
    LockingError,

    #[error("transparent")]
    EventProcessingError(#[from] keri_core::error::Error),

    #[error(transparent)]
    ResponseProcessingError(#[from] ResponseProcessingError),

    #[error("No kel events for {0} saved")]
    UnknownIdentifierError(IdentifierPrefix),

    #[error("Can't generate event: {0}")]
    EventGenerationError(String),

    #[error("Not group participant")]
    NotGroupParticipantError,

    #[error("Error: {0}")]
    OtherError(String),

    #[error("Wrong event type")]
    WrongEventTypeError,

    #[error("Wrong event format")]
    EventFormatError,

    #[error("Inception event error: {0}")]
    InceptionError(String),

    #[error("Improper witness prefix, should be basic prefix")]
    WrongWitnessPrefixError,

    #[error("Oobi error: {0}")]
    OobiError(#[from] OobiError),

    #[error("Broadcasting error: {0}")]
    BroadcastingError(#[from] BroadcastingError),
}