1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum EthIdError {
5 #[error("Document parsing failed: {0}")]
6 DocumentParsing(String),
7
8 #[error("Claim parsing failed: {0}")]
9 ClaimParsing(String),
10
11 #[error("Claim validation failed: {0}")]
12 ClaimValidation(String),
13
14 #[error("Privacy filter error: {0}")]
15 PrivacyFilter(String),
16
17 #[error("LLM provider error: {0}")]
18 LlmProvider(String),
19
20 #[error("ZK proof error: {0}")]
21 ZkProof(String),
22
23 #[error("Attestation error: {0}")]
24 Attestation(String),
25
26 #[error("Audit log error: {0}")]
27 AuditLog(String),
28
29 #[error("Configuration error: {0}")]
30 Config(String),
31
32 #[error("Network call blocked in offline mode")]
33 OfflineMode,
34
35 #[error("Invalid document format: {0}")]
36 InvalidFormat(String),
37
38 #[error("Document too large: {0}")]
39 DocumentTooLarge(String),
40
41 #[error("IO error: {0}")]
42 Io(#[from] std::io::Error),
43
44 #[error("JSON error: {0}")]
45 Json(#[from] serde_json::Error),
46}
47
48pub type Result<T> = std::result::Result<T, EthIdError>;