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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//! Error handling for TAP Agent
//!
//! This module provides error types and utilities for the TAP Agent.
use thiserror::Error;
/// Type alias for Results with TAP Agent errors
pub type Result<T> = std::result::Result<T, Error>;
/// Error types for TAP Agent
#[derive(Error, Debug)]
pub enum Error {
/// Core TAP errors
#[error("Core error: {0}")]
Core(#[from] tap_msg::error::Error),
/// Validation errors
#[error("Validation error: {0}")]
Validation(String),
/// DID resolution errors
#[error("DID resolution error: {0}")]
DidResolution(String),
/// Error related to invalid DID
#[error("Invalid DID")]
InvalidDID,
/// Error for unsupported DID method
#[error("Unsupported DID method: {0}")]
UnsupportedDIDMethod(String),
/// Error when failed to acquire resolver read lock
#[error("Failed to acquire resolver read lock")]
FailedToAcquireResolverReadLock,
/// Error when failed to acquire resolver write lock
#[error("Failed to acquire resolver write lock")]
FailedToAcquireResolverWriteLock,
/// Error related to missing configuration
#[error("Missing configuration: {0}")]
MissingConfig(String),
/// Error related to cryptographic operations
#[error("Crypto error: {0}")]
Crypto(String),
/// Error related to cryptographic operations during signing/encryption
#[error("Cryptography error: {0}")]
Cryptography(String),
/// Error related to message processing
#[error("Message error: {0}")]
Message(String),
/// Error related to policy evaluation
#[error("Policy error: {0}")]
Policy(String),
/// Error related to storage
#[error("Storage error: {0}")]
Storage(String),
/// IO errors
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
/// Serialization errors
#[error("Serialization error: {0}")]
Serialization(String),
/// Feature not implemented
#[error("Feature not implemented: {0}")]
NotImplemented(String),
/// Key not found
#[error("Key not found: {0}")]
KeyNotFound(String),
/// DIDComm specific errors
#[error("DIDComm error: {0}")]
DIDComm(String),
/// DID Resolution error
#[error("DID Resolution error: {0}")]
DIDResolution(String),
/// JavaScript error (WASM)
#[cfg(target_arch = "wasm32")]
#[error("JavaScript error: {0}")]
JsError(String),
/// JavaScript resolver error (WASM)
#[cfg(target_arch = "wasm32")]
#[error("JavaScript resolver error: {0}")]
JsResolverError(String),
/// Serde JSON error
#[error("Serde JSON error: {0}")]
SerdeError(#[from] serde_json::Error),
/// Networking error
#[error("Networking error: {0}")]
Networking(String),
/// Runtime error
#[error("Runtime error: {0}")]
Runtime(String),
}