1use thiserror::Error;
6
7pub type Result<T> = std::result::Result<T, Error>;
9
10#[derive(Error, Debug)]
12pub enum Error {
13 #[error("Core error: {0}")]
15 Core(#[from] tap_msg::error::Error),
16
17 #[error("Validation error: {0}")]
19 Validation(String),
20
21 #[error("DID resolution error: {0}")]
23 DidResolution(String),
24
25 #[error("Invalid DID")]
27 InvalidDID,
28
29 #[error("Unsupported DID method: {0}")]
31 UnsupportedDIDMethod(String),
32
33 #[error("Failed to acquire resolver read lock")]
35 FailedToAcquireResolverReadLock,
36
37 #[error("Failed to acquire resolver write lock")]
39 FailedToAcquireResolverWriteLock,
40
41 #[error("Missing configuration: {0}")]
43 MissingConfig(String),
44
45 #[error("Crypto error: {0}")]
47 Crypto(String),
48
49 #[error("Cryptography error: {0}")]
51 Cryptography(String),
52
53 #[error("Message error: {0}")]
55 Message(String),
56
57 #[error("Policy error: {0}")]
59 Policy(String),
60
61 #[error("Storage error: {0}")]
63 Storage(String),
64
65 #[error("IO error: {0}")]
67 Io(#[from] std::io::Error),
68
69 #[error("Serialization error: {0}")]
71 Serialization(String),
72
73 #[error("Feature not implemented: {0}")]
75 NotImplemented(String),
76
77 #[error("Key not found: {0}")]
79 KeyNotFound(String),
80
81 #[error("DIDComm error: {0}")]
83 DIDComm(String),
84
85 #[error("DID Resolution error: {0}")]
87 DIDResolution(String),
88
89 #[cfg(target_arch = "wasm32")]
91 #[error("JavaScript error: {0}")]
92 JsError(String),
93
94 #[cfg(target_arch = "wasm32")]
96 #[error("JavaScript resolver error: {0}")]
97 JsResolverError(String),
98
99 #[error("Serde JSON error: {0}")]
101 SerdeError(#[from] serde_json::Error),
102
103 #[error("Networking error: {0}")]
105 Networking(String),
106
107 #[error("Runtime error: {0}")]
109 Runtime(String),
110}