venus_sync/
error.rs

1//! Error types for the sync engine.
2
3use std::path::PathBuf;
4
5/// Result type for sync operations.
6pub type SyncResult<T> = Result<T, SyncError>;
7
8/// Errors that can occur during sync operations.
9#[derive(Debug, thiserror::Error)]
10pub enum SyncError {
11    /// Failed to read source file.
12    #[error("Failed to read file {path}: {message}")]
13    ReadError { path: PathBuf, message: String },
14
15    /// Failed to write output file.
16    #[error("Failed to write file {path}: {message}")]
17    WriteError { path: PathBuf, message: String },
18
19    /// Failed to parse RS file.
20    #[error("Parse error: {0}")]
21    ParseError(String),
22
23    /// Failed to serialize/deserialize JSON.
24    #[error("JSON error: {0}")]
25    JsonError(#[from] serde_json::Error),
26
27    /// I/O error.
28    #[error("I/O error: {0}")]
29    IoError(#[from] std::io::Error),
30
31    /// Invalid notebook structure.
32    #[error("Invalid notebook: {0}")]
33    InvalidNotebook(String),
34}