1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, Error>;
4
5#[derive(Error, Debug)]
6pub enum Error {
7 #[error("Database error: {0}")]
8 Database(#[from] rusqlite::Error),
9
10 #[error("IO error: {0}")]
11 Io(#[from] std::io::Error),
12
13 #[error("Serialization error: {0}")]
14 Serialization(#[from] serde_json::Error),
15
16 #[error("Change not found: {0}")]
17 ChangeNotFound(String),
18
19 #[error("Commit not found: {0}")]
20 CommitNotFound(String),
21
22 #[error("Session not found: {0}")]
23 SessionNotFound(String),
24
25 #[error("Invalid path: {0}")]
26 InvalidPath(String),
27
28 #[error("Rollback failed: {0}")]
29 RollbackFailed(String),
30
31 #[error("Diff generation failed: {0}")]
32 DiffFailed(String),
33
34 #[error("No active session")]
35 NoActiveSession,
36
37 #[error("Session already active at: {0}")]
38 SessionAlreadyActive(String),
39
40 #[error("Invalid operation: {0}")]
41 InvalidOperation(String),
42}