1use thiserror::Error;
4
5pub type SyncResult<T> = Result<T, SyncError>;
7
8#[derive(Error, Debug)]
10pub enum SyncError {
11 #[error("Concurrent events detected: {0}")]
13 ConcurrentEvents(String),
14
15 #[error("Invalid operation: {0}")]
17 InvalidOperation(String),
18
19 #[error("Merkle tree verification failed: {0}")]
21 MerkleVerificationFailed(String),
22
23 #[error("Delta encoding error: {0}")]
25 DeltaEncodingError(String),
26
27 #[error("Device coordination error: {0}")]
29 CoordinationError(String),
30
31 #[error("CRDT merge conflict: {0}")]
33 MergeConflict(String),
34
35 #[error("Serialization error: {0}")]
37 SerializationError(String),
38
39 #[error("I/O error: {0}")]
41 IoError(#[from] std::io::Error),
42
43 #[error("JSON error: {0}")]
45 JsonError(#[from] serde_json::Error),
46
47 #[error("Invalid device ID: {0}")]
49 InvalidDeviceId(String),
50
51 #[error("Operation timeout: {0}")]
53 Timeout(String),
54
55 #[error("Network error: {0}")]
57 NetworkError(String),
58
59 #[error("State inconsistency: {0}")]
61 StateInconsistency(String),
62}