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("Missing configuration: {0}")]
39 MissingConfig(String),
40
41 #[error("Crypto error: {0}")]
43 Crypto(String),
44
45 #[error("Message error: {0}")]
47 Message(String),
48
49 #[error("Policy error: {0}")]
51 Policy(String),
52
53 #[error("Storage error: {0}")]
55 Storage(String),
56
57 #[error("IO error: {0}")]
59 Io(#[from] std::io::Error),
60
61 #[error("Serialization error: {0}")]
63 Serialization(String),
64
65 #[error("Feature not implemented: {0}")]
67 NotImplemented(String),
68
69 #[error("DIDComm error: {0}")]
71 DIDComm(#[from] didcomm::error::Error),
72
73 #[error("DID Resolution error: {0}")]
75 DIDResolution(String),
76
77 #[cfg(target_arch = "wasm32")]
79 #[error("JavaScript error: {0}")]
80 JsError(String),
81
82 #[cfg(target_arch = "wasm32")]
84 #[error("JavaScript resolver error: {0}")]
85 JsResolverError(String),
86
87 #[error("Serde JSON error: {0}")]
89 SerdeError(#[from] serde_json::Error),
90}