| 1 | pub type Result<T> = std::result::Result<T, Error>; |
| 2 | |
| 3 | #[derive(Debug, thiserror::Error)] |
| 4 | pub enum Error { |
| 5 | #[error("database error: {0}")] |
| 6 | Sqlite(#[from] rusqlite::Error), |
| 7 | #[error("cannot create the data directory {path}: {source}")] |
| 8 | DataDirectory { |
| 9 | path: String, |
| 10 | source: std::io::Error, |
| 11 | }, |
| 12 | #[error("no platform data directory available")] |
| 13 | NoDataDirectory, |
| 14 | #[error("database schema version {found} is newer than this build supports ({supported})")] |
| 15 | SchemaTooNew { found: i64, supported: i64 }, |
| 16 | #[error("image file cache: {0}")] |
| 17 | ImageFiles(#[from] std::io::Error), |
| 18 | #[error("database lock poisoned")] |
| 19 | Poisoned, |
| 20 | } |