| 79 | /// Errors that can occur during change operations. |
| 80 | #[derive(Debug, Error)] |
| 81 | pub enum ChangeError { |
| 82 | /// IO error during read/write |
| 83 | #[error("IO error: {0}")] |
| 84 | Io(#[from] std::io::Error), |
| 85 | |
| 86 | /// V3 format error (postcard serialization, compression, hash verification, etc.) |
| 87 | #[error("Format error: {0}")] |
| 88 | Format(#[from] format_v3::FormatError), |
| 89 | |
| 90 | /// JSON error for unhashed section |
| 91 | #[error("JSON error: {0}")] |
| 92 | Json(#[from] serde_json::Error), |
| 93 | |
| 94 | /// Hash mismatch during verification |
| 95 | #[error("Change hash mismatch: claimed {claimed}, computed {computed}")] |
| 96 | HashMismatch { claimed: String, computed: String }, |
| 97 | |
| 98 | /// Contents hash mismatch |
| 99 | #[error("Contents hash mismatch: claimed {claimed}, computed {computed}")] |
| 100 | ContentsHashMismatch { claimed: String, computed: String }, |
| 101 | |
| 102 | /// Missing required content |
| 103 | #[error("Missing contents for hash {hash}")] |
| 104 | MissingContents { hash: String }, |
| 105 | |
| 106 | /// Invalid change structure |
| 107 | #[error("Invalid change: {0}")] |
| 108 | Invalid(String), |
| 109 | |
| 110 | /// Invalid or noncanonical hashed change facts. |
| 111 | #[error(transparent)] |
| 112 | Validation(#[from] ChangeValidationError), |
| 113 | } |
| 114 | |
| 115 | /// A complete change (patch). |
| 116 | /// |
no outgoing calls
no test coverage detected