post_archiver/error.rs
1//! Error types for the post archiver system.
2
3/// The main error type for post archiver operations.
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6 /// A SQLite database error.
7 #[error(transparent)]
8 Rusqlite(#[from] rusqlite::Error),
9
10 /// A filesystem I/O error.
11 #[error(transparent)]
12 Io(#[from] std::io::Error),
13
14 /// The database already exists at the given path.
15 #[error("database already exists")]
16 DatabaseAlreadyExists,
17
18 /// The database version does not match the expected version.
19 #[error("database version mismatch: current {current}, expected {expected}")]
20 VersionMismatch { current: String, expected: String },
21}
22
23/// A specialized `Result` type for post archiver operations.
24pub type Result<T> = std::result::Result<T, Error>;