| 259 | |
| 260 | impl From<ContentError> for OutputError { |
| 261 | fn from(err: ContentError) -> Self { |
| 262 | match err { |
| 263 | ContentError::Io(e) => OutputError::Io(e), |
| 264 | ContentError::ChangeNotFound { hash } => OutputError::MissingChange { hash }, |
| 265 | ContentError::Truncated { expected, actual } => OutputError::ChangeStore { |
| 266 | message: format!( |
| 267 | "Content truncated: expected {} bytes, got {}", |
| 268 | expected, actual |
| 269 | ), |
| 270 | hash: None, |
| 271 | }, |
| 272 | ContentError::VertexContent { node } => OutputError::NodeNotFound { |
| 273 | node, |
| 274 | change_id: Some(node.change), |
| 275 | }, |
| 276 | } |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | /// Result type alias for content operations. |