1use std::path::PathBuf;
4
5pub type SyncResult<T> = Result<T, SyncError>;
7
8#[derive(Debug, thiserror::Error)]
10pub enum SyncError {
11 #[error("Failed to read file {path}: {message}")]
13 ReadError { path: PathBuf, message: String },
14
15 #[error("Failed to write file {path}: {message}")]
17 WriteError { path: PathBuf, message: String },
18
19 #[error("Parse error: {0}")]
21 ParseError(String),
22
23 #[error("JSON error: {0}")]
25 JsonError(#[from] serde_json::Error),
26
27 #[error("I/O error: {0}")]
29 IoError(#[from] std::io::Error),
30
31 #[error("Invalid notebook: {0}")]
33 InvalidNotebook(String),
34}