vex_anchor/
error.rs

1//! Error types for anchoring operations
2
3use thiserror::Error;
4
5/// Errors that can occur during anchoring operations
6#[derive(Debug, Error)]
7pub enum AnchorError {
8    /// Backend is not available or misconfigured
9    #[error("Backend unavailable: {0}")]
10    BackendUnavailable(String),
11
12    /// Failed to write anchor data
13    #[error("Write failed: {0}")]
14    WriteFailed(String),
15
16    /// Failed to read anchor data
17    #[error("Read failed: {0}")]
18    ReadFailed(String),
19
20    /// Anchor not found during verification
21    #[error("Anchor not found: {0}")]
22    NotFound(String),
23
24    /// Anchor verification failed (tampering detected)
25    #[error("Verification failed: {0}")]
26    VerificationFailed(String),
27
28    /// Serialization/deserialization error
29    #[error("Serialization error: {0}")]
30    Serialization(#[from] serde_json::Error),
31
32    /// I/O error
33    #[error("I/O error: {0}")]
34    Io(#[from] std::io::Error),
35
36    /// Git operation failed
37    #[error("Git error: {0}")]
38    Git(String),
39
40    /// Blockchain/network error
41    #[error("Network error: {0}")]
42    Network(String),
43}