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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
use keri_core::{
    actor::prelude::VersionError, event_message::cesr_adapter::ParseError, oobi::Scheme,
    prefix::IdentifierPrefix,
};
use thiserror::Error;

#[derive(Error, Debug)]
pub enum ControllerError {
    #[error("Database error: {0}")]
    DatabaseError(#[from] keri_core::database::DbError),

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

    #[error("Communication error: {0}")]
    CommunicationError(String),

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

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

    #[error("Can't parse event")]
    EventParseError,

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

    #[error("Keri event parsing error: {0}")]
    ParseError(#[from] ParseError),

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

    #[error("missing event")]
    MissingEventError,

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

    #[error("Unknown identifier")]
    UnknownIdentifierError,

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

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

    #[error("Keri version error: ")]
    VersionError(#[from] VersionError),

    #[error("No location for {id} with {scheme:?}")]
    NoLocationScheme {
        id: IdentifierPrefix,
        scheme: Scheme,
    },

    #[error("Query error: {0}")]
    QueryArgumentError(String),

    #[error("Cesr error")]
    CesrFormatError,

    #[error("Wrong signature")]
    FaultySignature,

    #[error("Verification failed for following elements: {0:?}")]
    VerificationError(Vec<(ControllerError, String)>),

    #[error(transparent)]
    TelError(#[from] teliox::error::Error),

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